public static Boolean WriteFile(string path, string str)
{
try
{
FileStream fs = new FileStream(path, FileMode.Create);
StreamWriter sw = new StreamWriter(fs);
//开始写入
sw.Write(str);
//清空缓冲区
sw.Flush();
//关闭流
sw.Close();
fs.Close();
return true;
}
catch (Exception ex)
{
return false;
}
}