// fread2.cs using System; using System.IO; using System.Text; class FileRead2 { static void Main() { string text = ""; using (StreamReader sr = new StreamReader( "readme.txt", Encoding.GetEncoding("Shift_JIS"))) { text = sr.ReadToEnd(); } Console.Write(text); } } // コンパイル方法:csc fread2.cs