以前创建用 String filePath = HttpContext.Current.Server.MapPath(FileName); if (!System.IO.File.Exists(filePath))// 创建文件 System.IO.File.Create(filePath); System.IO.StreamWriter sw = new System.IO.StreamWriter(filePath, false); sw.WriteLine(html); sw.Close(); 文章来源于 http://www.cnblogs.com/wf225 版权归原作者所有