Saturday, January 24, 2009

File Handling in Asp.net

using System.IO;

private void button2_Click(object sender, System.EventArgs e)
{
TextReader tr = new StreamReader("c:/t.txt");

string s = tr.ReadLine();

while(s != null)
{
s = tr.ReadLine();
this.textBox2.Text += s + "\n";
}

tr.Close();
}

No comments:

Post a Comment