if (System.IO.Directory.Exists(Server.MapPath(System.DateTime.Now.Year.ToString() + "-" + System.DateTime.Now.Month.ToString() + "-" + System.DateTime.Now.Day.ToString())) == false) //判断文件夹是否存在 { System.IO.Directory.CreateDirector
if (System.IO.Directory.Exists(Server.MapPath(System.DateTime.Now.Year.ToString() + "-" + System.DateTime.Now.Month.ToString() + "-" + System.DateTime.Now.Day.ToString())) == false) //判断文件夹是否存在
{
System.IO.Directory.CreateDirectory(Server.MapPath(System.DateTime.Now.Year.ToString() + "-" + System.DateTime.Now.Month.ToString() + "-" + System.DateTime.Now.Day.ToString())); //创建文件夹
}
System.IO.Directory.Delete(Server.MapPath(System.DateTime.Now.Year.ToString() + "-" + System.DateTime.Now.Month.ToString() + "-" + System.DateTime.Now.Day.ToString()), true); //删除文件夹
if (System.IO.File.Exists(Server.MapPath(System.DateTime.Now.Year.ToString() + "-" + System.DateTime.Now.Month.ToString() + "-" + System.DateTime.Now.Day.ToString() + "/chenes.txt")))
{//存在文件
System.IO.File.Delete(Server.MapPath(System.DateTime.Now.Year.ToString() + "-" + System.DateTime.Now.Month.ToString() + "-" + System.DateTime.Now.Day.ToString() + "/chenes.txt"));
}
else
{
//不存在文件
System.IO.File.CreateText(Server.MapPath(System.DateTime.Now.Year.ToString() + "-" + System.DateTime.Now.Month.ToString() + "-" + System.DateTime.Now.Day.ToString() + "/chenes.txt"));//创建该文件
}