标签:
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;
}
标签:
原文地址:http://www.cnblogs.com/luny147258/p/5615472.html