string _FullPath = HttpContext.Current.Server.MapPath(_Path + _TxtName); if (!System.IO.File.Exists(_FullPath))//如果文件不存在
{
if (!System.IO.Directory.Exists(_Path)) //如果目录不存在
{
System.IO.Directory.CreateDirectory(HttpContext.Current.Server.MapPath(_Path));//创建所有目录
}
System.IO.File.CreateText(_FullPath); //创建文件
}
{
if (!System.IO.Directory.Exists(_Path)) //如果目录不存在
{
System.IO.Directory.CreateDirectory(HttpContext.Current.Server.MapPath(_Path));//创建所有目录
}
System.IO.File.CreateText(_FullPath); //创建文件
}