C#读取文件的所有行到数组
using System; namespace PlayingAround { class ReadAll { public static void Main(string[] args) { string[] lines = System.IO.File.ReadAllLines(@"C:\t1"); Console.Out.WriteLine("contents = " + lines.Length); Console.In.ReadLine(); } } }
C#读取文件的所有行到数组
using System; namespace PlayingAround { class ReadAll { public static void Main(string[] args) { string[] lines = System.IO.File.ReadAllLines(@"C:\t1"); Console.Out.WriteLine("contents = " + lines.Length); Console.In.ReadLine(); } } }