会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
FredGrit
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
98
99
100
101
102
103
104
105
106
···
123
下一页
2020年6月17日
C# read and compute the code lines number of cs files based on given directory
摘要: static void ComputeCodeLines() { string dir = @"D:\Work"; int totalLines = 0; string[] allFiles = Directory.GetFiles(dir, "*.cs", SearchOption.AllDire
阅读全文
posted @ 2020-06-17 12:14 FredGrit
阅读(125)
评论(0)
推荐(0)
2020年6月15日
C# StreamWriter log batch message sync and async
摘要: using System; using System.Diagnostics; using System.IO; using System.Text; using System.Threading.Tasks; static StreamWriter Syncsw = new StreamWrite
阅读全文
posted @ 2020-06-15 12:04 FredGrit
阅读(189)
评论(0)
推荐(0)
2020年6月9日
HttpClient SendAsync
摘要: static async void HttpClientSendAsync() { var client = new HttpClient(new HttpClientHandler { UseProxy = false }); var request = new HttpRequestMessag
阅读全文
posted @ 2020-06-09 12:03 FredGrit
阅读(1124)
评论(0)
推荐(0)
WebRequest, WebRequest.Create GetResponse() GetResponseStream()
摘要: static void WebRequestDemo() { WebRequest req = WebRequest.Create("https://5b0988e595225.cdn.sohucs.com/images/20180422/bd1d3910de4945a7996eee3c1eedd0
阅读全文
posted @ 2020-06-09 10:58 FredGrit
阅读(365)
评论(0)
推荐(0)
2020年6月8日
C# FileSystemWatcher
摘要: static void Main(string[] args) { Task task = Task.Run(() => { CreateRndTextFiles(); }); string path = Directory.GetCurrentDirectory(); FileSystemWatc
阅读全文
posted @ 2020-06-08 20:35 FredGrit
阅读(434)
评论(0)
推荐(0)
Access Volumn via extern and invoke win 32 dll
摘要: const int SupportsCompression = 0x10; const int SupportEncryption = 0x20000; [DllImport("Kernel32.dll", SetLastError = true)] extern static bool GetVo
阅读全文
posted @ 2020-06-08 18:45 FredGrit
阅读(241)
评论(0)
推荐(0)
Change file readonly property File.SetAttribute and new FileInfo readonly property
摘要: 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
阅读(167)
评论(0)
推荐(0)
C# zip folder
摘要: static void ZipFolderDemo() { string path = Directory.GetCurrentDirectory(); string zippedFile = Path.Combine(path, path+".zip"); Console.WriteLine($"
阅读全文
posted @ 2020-06-08 17:40 FredGrit
阅读(160)
评论(0)
推荐(0)
GZipStream Compress And Decompress
摘要: static string dir = @"D:\C\ConsoleApp2"; static void GZipCompressDemo() { string[] filesArr = Directory.GetFiles(dir, "*", SearchOption.AllDirectories
阅读全文
posted @ 2020-06-08 15:45 FredGrit
阅读(195)
评论(0)
推荐(0)
C# list top 20 biggest files via given path
摘要: static void ListTop20BiggestFile() { string str = @"D:\C"; var files = Directory.GetFiles(str, "*", SearchOption.AllDirectories).OrderByDescending(x =
阅读全文
posted @ 2020-06-08 14:43 FredGrit
阅读(132)
评论(0)
推荐(0)
上一页
1
···
98
99
100
101
102
103
104
105
106
···
123
下一页
公告