「C#入門」ReadAllLines()でファイルを配列に読み込むサンプル

サンプルコード
using System;
namespace PlayingAround {
class ReadAll {
public static void Main(string[] args) {
string[] lines = System.IO.File.ReadAllLines(@"D:\txtfile");
Console.Out.WriteLine(“contents = " + lines.Length);
Console.In.ReadLine();
}
}
}

C#

Posted by arkgame