为什么生成文件老在C:\Inetpub\wwwroot下,请求。我的虚拟目录指定在了别的盘下了呀?
string Filename = DateTime.Now.ToString("yyyyMMddHHmmss") + ".html";//动态的文件名
string Filepath = Server.MapPath(@"\Files\test\");
string Cname = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString();
string Filecreatepath = Filepath + Cname + @"\";//页面要保存的路径 //动态生成的静态页面按年月保存本年本月的文件夹中
if (Directory.Exists(Filecreatepath)) //判断当月的文件夹是否存在,
{
//调用创建html静态页面方法
Create_html(Filecreatepath + Filename, dhtml);
}
else
{
//创建页面保存到的文件夹
DirectoryInfo di = Directory.CreateDirectory(Filecreatepath);
Create_html(Filecreatepath + Filename, dhtml);
}
string Filename = DateTime.Now.ToString("yyyyMMddHHmmss") + ".html";//动态的文件名
string Filepath = Server.MapPath(@"\Files\test\");
string Cname = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString();
string Filecreatepath = Filepath + Cname + @"\";//页面要保存的路径 //动态生成的静态页面按年月保存本年本月的文件夹中
if (Directory.Exists(Filecreatepath)) //判断当月的文件夹是否存在,
{
//调用创建html静态页面方法
Create_html(Filecreatepath + Filename, dhtml);
}
else
{
//创建页面保存到的文件夹
DirectoryInfo di = Directory.CreateDirectory(Filecreatepath);
Create_html(Filecreatepath + Filename, dhtml);
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货