try
using System.IO;
StreamReader sr = new StreamReader("YourFileName", System.Text.Encoding.GetEncoding("GB2312"));String s = sr.ReadToEnd();sr.Close();

解决方案 »

  1.   

    可以把WORD文档的内容读出来吗
      

  2.   

    思归的是演示如何读取文本文件,但是word有自己的一套格式,
    具体参考这个:string xx,yy; 
    Word.ApplicationClass oWord = new Word.ApplicationClass(); 
    Word.Document oDoc; 
    Word.Range oRange; 
    Word.Table otable; 
    Word.Selection  oselection; 
    object a = Missing.Value; 
    object b = Missing.Value; 
    object filename=@"c:\test.doc"; 
    oDoc = oWord.Documents.Open(ref filename,ref a,ref a,ref a,ref 
    //or oDoc = oWord.Documents.Add(ref a,ref a,ref a,ref a); 
    a,ref a,ref a,ref a,ref a,ref a,ref a,ref a);   
    oWord.Visible = true; 
    oDoc = oWord.ActiveDocument 
    oRange = oDoc.Range(ref a,ref b); 
    oRange.Rows.Count = 9; 
    oRange.Select; 
    xx =oRange.Text;   
    otable = oDoc.Tables.Item(1); 
    otable.Select; 
    yy = otable.Cell(0,1).Range.Text;
      

  3.   

    补充:
    添加word的引用(2000是word9,XP是word10)然后: 参考这些:
    http://groups.google.com/groups?q=C%23+word&hl=en&selm=mGUtR1GwBHA.1532%40cpmsftngxa09&rnum=4