コード例 #1
0
 static string OldestOf(string one, string two)
 {
     ReportInfo a = new ReportInfo(one);
     ReportInfo b = new ReportInfo(two);
     if (a.Date < b.Date)
         return one;
     else
         return two;
 }
コード例 #2
0
        // Maybe change this to where you can specify the timespan.
        public virtual void ArchiveOldLogs()
        {
            string[] files = Directory.GetFiles(logFilePath, "*.txt", System.IO.SearchOption.TopDirectoryOnly);
            List<FileInfo> moveList = new List<FileInfo>();

            for (int i = 0; i < files.Length; i++)
            {
                ReportInfo current = new ReportInfo(files[i]);
                if(DateTime.Now - current.Date > new TimeSpan(24, 0, 0))
                    moveList.Add(new FileInfo(files[i]));
            }

            ArchiveFiles(logFilePath, moveList);
        }
コード例 #3
0
 static string RegionAndItem(string fullpath)
 {
     ReportInfo info = new ReportInfo(fullpath);
     return info.Region + " - " + info.ItemName;
 }
コード例 #4
0
ファイル: ReportInfo.cs プロジェクト: spiffydudex/navbot
 public static int CompareByDate(ReportInfo a, ReportInfo b)
 {
     return DateTime.Compare(a.date, b.date);
 }