怎样读取中文内容的文件??
只能读取txt类型的文件吗??我想读取word、adobe格式的文件可以吗?代码怎么写??

解决方案 »

  1.   


    using System;
    using System.IO;class FSRead
    {
        public static void Main()
        {
            //Create a file stream from an existing file.
            FileInfo fi=new FileInfo("c:\\csc.txt");       
            FileStream fs=fi.OpenRead();        //Read 100 bytes into an array from the specified file.
            int nBytes=100;
            byte[] ByteArray=new byte[nBytes];
            int nBytesRead=fs.Read(ByteArray, 0, nBytes);
            Console.WriteLine("{0} bytes have been read from the specified file.", nBytesRead.ToString());
        }
    }
      

  2.   

    textBox2.Text = File.ReadAllText(openFileDialog1.FileName);结果 中文无法显示出来
    ????
      

  3.   

    麻烦高手看下小弟的菜鸟问题:http://topic.csdn.net/u/20090423/13/6c91a301-92de-4d7a-b607-8c39c5affae6.html
      

  4.   

    word、adobe的文件结构和txt不一样,有专门读取word的方法