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;
}

时间: 2024-10-21 08:44:43

DateTimeCheck的相关文章

validator指令实现

最近阅读项目代码,学习前辈编写angular指令的方式.不涉及关键的业务代码,所以应该没有保密性问题.希望通过写这篇博客明白validator指令是怎么实现的. 像这样使用: 校验功能的实现依赖provider validator和若干directive. provider的结构是这样的: .provider('validator', [function() { var validatorFn = function(){//....}; validatorFn.prototype = {//..