private void savedata()
{
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すると落ちるが、何とかならないものだろうか?