Retrieve the data from Text File
<p>I have a little project. What I am doing is, taking inputs from users and saving it in a text file. Its working good. </p>

<pre><code>private void btbsave_Click(object sender, EventArgs e)
{
    //Create Directory
    DirectoryInfo dd = new DirectoryInfo("C://Program Files/UserInfo");
    dd.Create();
    //To save the inputs
    StreamWriter sw = new StreamWriter("C://Program Files/UserInfo/UserInfo.txt", true);
    sw.WriteLine(txtname.Text);
    sw.WriteLine(txtage.Text);
    sw.Flush();
    sw.Close();
    //Conformation
    MessageBox.Show("Credentials Saved");
    //To Clear the text box after data saved
    txtname.Text = string.Empty;
    txtage.Text = string.Empty;
    //Focus
    txturl.Focus();
}
</code></pre>

<p>And now, I want to retrieve the data depending on the inputs. This part is difficult for me, can you guys help me out?</p>

<pre><code>private void btnsearch_Click(object sender, EventArgs e)
{
     StreamReader sr = new StreamReader("C://Program Files/UserInfo/UserInfo.txt");
     String mystring = sr.ReadToEnd();
     //No idea how to retrive now plz help!
}
</code></pre>

<p>Brief description of my project:
Take some values from users like <em>UserName</em> and <em>Age</em>. Save them in a text file. </p>

<p>I need to retrieve values based on user <em>UserName</em>. I should then get <em>UserName</em> along with his <em>Age</em> and insert these values into 2 different readonly text boxes.</p>
