Read a file that was created
<p>I have created a file now I want to read it back into the program.When I click button2 I want it to read the file and display it in label6.text </p>

<pre><code>public void writetext()
    {

        using (TextWriter writer = File.AppendText("filename.txt"))

        {
         writer.WriteLine("First name, {0} Lastname, {1} Phone,{2} Day of birth,{3} Month of Birth{4}", textBox1.Text, textBox2.Text, maskedTextBox1.Text, textBox4.Text, textBox3.Text);
         MessageBox.Show(String.Format("First Name,{0} Lastname, {1} Phone,{2} Day of birth,{3} Month of Birth{4}", textBox1.Text, textBox2.Text, maskedTextBox1.Text, textBox4.Text, textBox3.Text)); 
        }


    }
    public void reset()
    {
        textBox1.Text = "";
        textBox2.Text = "";
        textBox3.Text = "";
        textBox4.Text = "";
        maskedTextBox1.Text = "";
    }

    private void button3_Click(object sender, EventArgs e)
    {
        Close(); 
     }

    private void button2_Click(object sender, EventArgs e)


    {
        File.ReadAllLines("filename.txt");
        label6.Text = ("filename.text");
    }
}
</code></pre>

<p>}</p>
