Very Simple Code to Read a txt File in C#.net

StreamReader sr;
try
{
sr = File.OpenText("E:\\Avi.txt");
TextBox1.Text = sr.ReadToEnd();
sr.Close();
}
catch
{
TextBox1.Text = "Unable To Read File";
}

No comments:

Post a Comment