if(sdf.ShowDialog() ==DialogResult.OK)
{
using (StreamWriter sw = new StreamWriter(fileName, false, Encoding.Default))
sw.WriteLine ("Hello to you 你好");
}
catch(System.IO.IOException ex)
{
Console.WriteLine ("An IO exception has been thrown");
Console.WriteLine (ex.ToString ());
return;
}
这段代码就可以把汉字写到记事本上,本保存下来