string FileName=DateTime.Now.Date.ToString("yyyyMMddHHmmss")+".html";
string FilePath=Server.MapPath(@"\jingtai\Didi\");
string FileCreatPath=FilePath+FileName;
Create_html(FileCreatPath,dhtml);
private void Create_html(string allfilename,string htmlcode)
{
FileStream CreateFile =new FileStream(allfilename,FileMode.CreateNew);
StreamWriter sw = new StreamWriter(CreateFile);
sw.WriteLine(htmlcode);//将拼好的Html代码写入页面中
sw.Close();
Page.RegisterStartupScript("","<script>window.alert('The file created successfully.!')</script>");
}
显示的错误为
“/tzlinfo”应用程序中的服务器错误。
--------------------------------------------------------------------------------未找到路径“G:\tzlinfo\jingtai\Didi\20060919000000.html”的一部分。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.IO.DirectoryNotFoundException: 未找到路径“G:\tzlinfo\jingtai\Didi\20060919000000.html”的一部分。源错误:
行 99: private void Create_html(string allfilename,string htmlcode)
行 100: {
行 101: FileStream CreateFile =new FileStream ---------此处红色显示(allfilename,FileMode.CreateNew);
行 102: StreamWriter sw = new StreamWriter(CreateFile);
行 103: sw.WriteLine(htmlcode);//将拼好的Html代码写入页面中操作系统 window xp
解决方案 »
- 发布的应用程序,装了框架还是运行不了
- 使用Excel.Application 导出Excel的问题
- Winform程序提问,需要在主机和客户端间传送文件。请问如何做?
- 在WinForm中如何把datagridview任意一行设为当前行(CurrentRow).急!!!
- 如何将Excel转换为HTML!!!
- 问题无法定位,无比郁闷中,求高手指点!!
- 怎样解块“http://1.1500 internal server error" 在线等
- 请教高手一个VS.Net2003的安装配置方面的问题!
- 紧急问题,请教C#高手!!!!!
- encrypt method ?
- 请问VB中的mid 方法 C# 是哪个?
- 我想用扫描枪把条形码扫到某控件上显示,该怎么做啊!!!急!急!!急!!!
检查你的文件路径