Commit b1b579fd authored by 黄奎's avatar 黄奎

页面修改

parent 8f863cc6
......@@ -61,34 +61,37 @@ namespace Edu.WebApi.Timers
string rootBook = AppDomain.CurrentDomain.BaseDirectory;
try
{
LogHelper.Write("开始清理临时文件");
DirectoryInfo dir = new DirectoryInfo(rootBook + "/upfile/temporary");
DirectoryInfo[] dirArr = dir.GetDirectories();
foreach (DirectoryInfo item in dirArr)
if (dir != null && dir.Exists)
{
if (item.CreationTime < DateTime.Now.AddDays(-1))
item.Delete(true);
}
foreach (FileInfo fi in dir.GetFiles())
{
if (fi.CreationTime < DateTime.Now.AddDays(-1))
fi.Delete();
DirectoryInfo[] dirArr = dir.GetDirectories();
foreach (DirectoryInfo item in dirArr)
{
if (item.CreationTime < DateTime.Now.AddDays(-1))
item.Delete(true);
}
foreach (FileInfo fi in dir.GetFiles())
{
if (fi.CreationTime < DateTime.Now.AddDays(-1))
fi.Delete();
}
}
#region 导出文件的
DirectoryInfo QRdir = new DirectoryInfo(rootBook + "/upfile/ExportFile");
foreach (FileInfo fi in QRdir.GetFiles())
if (QRdir != null && QRdir.Exists)
{
if (fi.CreationTime < DateTime.Now.AddDays(-1))
fi.Delete();
foreach (FileInfo fi in QRdir.GetFiles())
{
if (fi.CreationTime < DateTime.Now.AddDays(-1))
fi.Delete();
}
}
#endregion
}
catch
{
LogHelper.Write("清理临时文件失败");
LogHelper.Write("清理临时文件失败_ClearFile");
}
Interlocked.Exchange(ref inTimer, 0);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment