Code 1StreamReader sr = new StreamReader(aFile,Encoding.Default)就可以解决 2 3实例代码。输出指定文件下的内容 4 5using System; 6using System.Collections.Generic; 7using System.Text; 8using System.IO; 910namespace ConsoleApplication1511{ 1213 class Program14 {15 static void Main(string[] args)16 {17 string strLine;18 Console.Write("请输入文件路径及文件名:");19 string mess = Console.ReadLine();20 FileStream aFile = new FileStream(mess, FileMode.Open);21 StreamReader sr = new StreamReader(aFile,Encoding.Default);22 strLine = sr.ReadToEnd();23 Console.WriteLine(strLine);24 Console.ReadLine();25 }26 }27}2829 转载于:https://www.cnblogs.com/kofzhoubiwen/archive/2008/06/28/1231637.html