12345678910111213141516171819 |
- // See https://aka.ms/new-console-template for more information
- Console.WriteLine("Hello, World!");
- Console.WriteLine();
- foreach (var arg in args)
- {
- var fi = new FileInfo(arg);
- var prefix = fi.CreationTime.ToString("yyMMddHHmm");
- if(fi.Name.StartsWith(prefix)) continue;
- var dir = Path.GetDirectoryName(fi.FullName);
- var name = Path.GetFileName(fi.FullName);
- var to = Path.Combine(dir,$"{prefix}-{name}");
- Console.WriteLine($"{prefix} - {name} @ {dir}");
- fi.MoveTo(to);
- }
- Console.WriteLine();
- Console.Write("Done. Press ENTER to exit...");
- Console.ReadLine();
|