62,046
社区成员
发帖
与我相关
我的任务
分享
//生成文件
public void RunFilesBuild(StringBuilder strhtml, string filePath)
{
if (System.IO.File.Exists(filePath) == true)
{
System.IO.File.Delete(filePath);
}
FileInfo finfo = new FileInfo(filePath);
using (FileStream fs = finfo.OpenWrite())
{
StreamWriter sw = new StreamWriter(fs, System.Text.Encoding.Default);
sw.WriteLine(strhtml);
sw.Flush();
sw.Close();
}
}