How to Read specific lines of text and display it on message box
<p>I am trying to create following.</p>

<p>My app is windows app and form contains following </p>

<ol>
<li>two text boxes one for name and another for comments </li>
<li>date time picker</li>
<li>set and reset button.</li>
</ol>

<p>now my app needs to work like following.</p>

<p>When i open my app it needs to show me the message reminding abt comments and name who made comment specifying date.</p>

<p>for this i m not using any DataBase i created file to store comments and name and date.</p>

<p>so my problem is how i should read text distinguishing name ,comments and date.</p>

<p>my code is as follows:</p>

<pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Windows.Forms;
namespace DateUpdater.Classes
{
    public class FileHandling
    {

        public bool WritetoFile(Classes.FileParameters Params)
        {


            string directoryPath = Environment.CurrentDirectory.ToString();

                 directoryPath = directoryPath.ToLower().Replace("\\bin\\debug", "\\Logs\\reminder.txt");
                File.AppendAllText(directoryPath, Params.Comments.ToString());

                File.AppendAllText(directoryPath, EndCharacter());
                File.AppendAllText(directoryPath, Params.Name.ToString());
                File.AppendAllText(directoryPath, EndCharacter());
                File.AppendAllText(directoryPath, Params.DateToSet.ToString());
                File.AppendAllText(directoryPath, EndCharacter());

                return true;

        }

        public Classes.FileParameters ReadFromFile()
        {
            Classes.FileParameters Params;
            string directoryPath = Environment.CurrentDirectory.ToString();

            directoryPath = directoryPath.ToLower().Replace("\\bin\\debug", "\\Logs\\reminder.txt");
          // string tempData= File.ReadAllText(directoryPath);
           var searchTarget = "/n";
           foreach (var line in File.ReadLines(directoryPath))
           {
               if (line.Contains(searchTarget))
               {

                   break; // then stop
               }
           }

           return null; 

        }

        public string EndCharacter()
        {
            return "/n";
        }

    }
}
</code></pre>

<p>please give me the solution...</p>
