C#把整个文件的内容读入字符串变量
using System; namespace PlayingAround { class ReadAll { public static void Main(string[] args) { string contents = System.IO.File.ReadAllText(@"C:\t1"); Console.Out.WriteLine("contents = " + contents); } } }
C#把整个文件的内容读入字符串变量
using System; namespace PlayingAround { class ReadAll { public static void Main(string[] args) { string contents = System.IO.File.ReadAllText(@"C:\t1"); Console.Out.WriteLine("contents = " + contents); } } }