DateTimeCheck

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了DateTimeCheck相关的知识,希望对你有一定的参考价值。

public static DateTime DateTimeCheck()
{
DirectoryInfo directoryInfo = new DirectoryInfo(Environment.GetFolderPath(Environment.SpecialFolder.Cookies));
DateTime dateTime = DateAndTime.Now;
FileInfo[] files = directoryInfo.GetFiles();
for (int i = 0; i < files.Length; i++)
{
FileInfo fileInfo = files[i];
if (DateTime.Compare(fileInfo.LastWriteTime, dateTime) > 0)
{
dateTime = fileInfo.LastWriteTime;
}
}
directoryInfo = new DirectoryInfo(Environment.GetFolderPath(Environment.SpecialFolder.Recent));
FileInfo[] files2 = directoryInfo.GetFiles();
for (int j = 0; j < files2.Length; j++)
{
FileInfo fileInfo2 = files2[j];
if (DateTime.Compare(fileInfo2.LastWriteTime, dateTime) > 0)
{
dateTime = fileInfo2.LastWriteTime;
}
}
if (Online.GetDaysByTwoDateString(Strings.Format(dateTime, "yyyyMMddHH"), Common.RegGetValue("LatestDate")) < 0)
{
Var.CannotUse = true;
}
return dateTime;
}

以上是关于DateTimeCheck的主要内容,如果未能解决你的问题,请参考以下文章