private static void RemoveLogFie()
{
if (string.IsNullOrEmpty(palocation))
{
//获取根目录所在地址
palocation = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetAssembly(typeof(FormListQCAnalyse)).Location);
}
string logLocation = palocation + @"\" + "logs" + @"\" + DateTime.Now.AddMonths(-3).ToString("yyyy-MM-dd");
if (Directory.Exists(logLocation))
{
foreach (string f in Directory.GetFileSystemEntries(logLocation))
{
if (File.Exists(f))
{
//如果有子文件删除文件
File.Delete(f);
}
else
{
循环递归删除子文件夹
//DeleteDir(f);
}
}
//删除空文件夹
Directory.Delete(logLocation);
}
}