码迷,mamicode.com
首页 > 其他好文 > 详细

DateTimeCheck

时间:2016-06-24 23:38:48      阅读:249      评论:0      收藏:0      [点我收藏+]

标签:

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

标签:

原文地址:http://www.cnblogs.com/luny147258/p/5615472.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!