المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : How to Read a .doc in C#



C# Programming
02-26-2010, 12:51 PM
Iam very new to this community, i want to read a .doc and display it to console. I tried with the following code but getting some garbage values in addition to actual code.

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
StreamReader file = new StreamReader("D:\\keywords\\id1.doc");
String st = "";
while (st != null)
{
st = file.ReadLine();
Console.WriteLine(st);
}
file.Close();
}
}
}

Can some body helpme out with the Process for reading a .doc file...




Thanks in Advance....