String str;
try{
StreamReader FILE = new StreamReader(ファイルパス);
while((str = FILE.ReadLine()) != null){
System.Console.WriteLine(str);//表示
}
}
catch(System.IO.FileNotFoundException ex ){
System.Console.WriteLine(ex.Message);
System.Console.Read();//エンターで終了
return -1;
}
finally{
//後処理
if (FILE != null)
{
FILE.Close();
}
}