Wednesday, December 9, 2009

How to read .doc document in ASP.NET?

protected void Button1_Click(object sender, EventArgs e)
{
string path="C:\\Documents and Settings\\Administrator\\My Documents\\abcd.txt";
using (StreamReader reader = new StreamReader(path))
{
string line;
while ((line = reader.ReadLine()) != null)
{
TextBox1.Text += "
" + line;

}
}

}

No comments:

Post a Comment