Update Namespaces
This commit is contained in:
31
Day/Q42023/Helper-2023-10-10.cs
Normal file
31
Day/Q42023/Helper-2023-10-10.cs
Normal file
@ -0,0 +1,31 @@
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System.Collections.ObjectModel;
|
||||
|
||||
namespace File_Folder_Helper.Day.Q42023;
|
||||
|
||||
internal static class Helper20231010
|
||||
{
|
||||
|
||||
internal static void HgCV(ILogger<Worker> logger, string argsZero)
|
||||
{
|
||||
long ticks;
|
||||
DateTime dateTime;
|
||||
TimeSpan timeSpan;
|
||||
string[] segments;
|
||||
DirectoryInfo argsZeroDirectoryInfo = new(argsZero);
|
||||
int padLength = "64-612464-4626_2023-10-10_06;37_AM_2529222011".Length;
|
||||
ReadOnlyCollection<DirectoryInfo> directoryInfoCollection = new(argsZeroDirectoryInfo.GetDirectories().OrderBy(l => l.LastWriteTime).ToArray());
|
||||
foreach (DirectoryInfo directoryInfo in directoryInfoCollection)
|
||||
{
|
||||
segments = directoryInfo.Name.Split('_');
|
||||
if (!long.TryParse(segments[^1], out ticks))
|
||||
continue;
|
||||
dateTime = new(ticks);
|
||||
timeSpan = new(ticks);
|
||||
dateTime = new(ticks);
|
||||
logger.LogInformation("{directory.Name} at {LastWriteTime} took {TotalMinutes} minutes(s)", directoryInfo.Name.PadRight(padLength, ' '), directoryInfo.LastWriteTime, Math.Round(timeSpan.TotalMinutes, 3));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user