摘要: static void Main(string[] args) { Task task = Task.Run(() => { CreateRndTextFiles(); }); string path = Directory.GetCurrentDirectory(); FileSystemWatc 阅读全文
posted @ 2020-06-08 20:35 FredGrit 阅读(427) 评论(0) 推荐(0) 编辑
摘要: const int SupportsCompression = 0x10; const int SupportEncryption = 0x20000; [DllImport("Kernel32.dll", SetLastError = true)] extern static bool GetVo 阅读全文
posted @ 2020-06-08 18:45 FredGrit 阅读(231) 评论(0) 推荐(0) 编辑
摘要: static void FileInfoChangeReadOnly() { string file = @"D:\C\ConsoleApp24\ConsoleApp24\bin\Debug\netcoreapp3.1\ConsoleApp23\ConsoleApp23\bin\Debug\netc 阅读全文
posted @ 2020-06-08 18:21 FredGrit 阅读(158) 评论(0) 推荐(0) 编辑
摘要: static void ZipFolderDemo() { string path = Directory.GetCurrentDirectory(); string zippedFile = Path.Combine(path, path+".zip"); Console.WriteLine($" 阅读全文
posted @ 2020-06-08 17:40 FredGrit 阅读(151) 评论(0) 推荐(0) 编辑
摘要: static string dir = @"D:\C\ConsoleApp2"; static void GZipCompressDemo() { string[] filesArr = Directory.GetFiles(dir, "*", SearchOption.AllDirectories 阅读全文
posted @ 2020-06-08 15:45 FredGrit 阅读(186) 评论(0) 推荐(0) 编辑
摘要: static void ListTop20BiggestFile() { string str = @"D:\C"; var files = Directory.GetFiles(str, "*", SearchOption.AllDirectories).OrderByDescending(x = 阅读全文
posted @ 2020-06-08 14:43 FredGrit 阅读(124) 评论(0) 推荐(0) 编辑