首页 > 其他 > 详细

DateTimeCheck

时间:2016-06-24 23:35:55      阅读:164      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!