using System.IO;
private static void WriteFile(string fn, string s)
{
try
{
StreamWriter wr = File.CreateText(fn);
wr.Write(s);
wr.Close();
}
catch
{
MessageBox.Show("Can't write file.", "Error",
MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
return;
}