0568デフォルトの名無しさん (ワッチョイ 239d-pQa0)
2018/01/18(木) 19:44:28.00ID:64hUXuXa0{
string name = "aaa.txt";
system.IO.StreamWriter sw;
try
{
sw = new IO.StreamWriter(name, false, System.Text.Encoding.GetEncoding("shift_jis"));
sw.WriteLine("aaaa");
}
catch (Exception ex)
{
MsgBox("Savedata error:" + ex.Message);
}
finally
{
sw.Close();
}
}
Newでエラーした場合にはSw.Closeすると落ちるが、何とかならないものだろうか?