上一页 1 ··· 50 51 52 53 54 55 56 57 58 ··· 76 下一页
摘要: static void AnonymousSerializeDemo() { var data = new { firstPart = new { item1 = "item1", item2 = "item2", item3 = 10 }, secondPart = new { pp1 = new 阅读全文
posted @ 2020-07-09 19:54 FredGrit 阅读(132) 评论(0) 推荐(0) 编辑
摘要: class Dirs { public string DirName { get; set; } public long DirSize { get; set; } } static void OrderFiles(string dir) { string[] dirs = Directory.Ge 阅读全文
posted @ 2020-06-30 11:04 FredGrit 阅读(186) 评论(0) 推荐(0) 编辑
摘要: The piped stream are bidirectional communcation.Meanwhile they can read and write. Write the NamedPipeServerStream and NamedPipeClientStream in two di 阅读全文
posted @ 2020-06-29 17:56 FredGrit 阅读(1309) 评论(0) 推荐(0) 编辑
摘要: static DataTable ReadExcelConvertToDataTable(string xlsxFileName) { DataTable dt = new DataTable(); try { IWorkbook book; using (FileStream fs = new F 阅读全文
posted @ 2020-06-26 19:51 FredGrit 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 1.Install-package npoi; 2.Add necessary namespace as below. using System.IO;using System.IO.Compression;using NPOI.HSSF.UserModel;using NPOI.SS.UserMo 阅读全文
posted @ 2020-06-26 18:33 FredGrit 阅读(256) 评论(0) 推荐(0) 编辑
摘要: Write the current to the local file. static void CopyStream(Stream stream, string destPath) { using (var fileStream = new FileStream(destPath, FileMod 阅读全文
posted @ 2020-06-26 18:14 FredGrit 阅读(180) 评论(0) 推荐(0) 编辑
摘要: static void AssemblyLoadContextDemo() { var assms = AssemblyLoadContext.All.SelectMany(x => x.Assemblies); if(assms!=null && assms.Any()) { foreach(va 阅读全文
posted @ 2020-06-22 15:52 FredGrit 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 1.Add resource file Resource1.resx via add new item in Console Application project; 2.Open Resource1.resx, Add Resource/Add Existing File, add multipl 阅读全文
posted @ 2020-06-19 16:49 FredGrit 阅读(235) 评论(0) 推荐(0) 编辑
摘要: 1.Add new folder Resources in project; 2.Add resource such as picture in the Resource folder; 3.Set the picture's Build Action as Embedded Resource in 阅读全文
posted @ 2020-06-17 18:16 FredGrit 阅读(266) 评论(0) 推荐(0) 编辑
摘要: 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 阅读(115) 评论(0) 推荐(0) 编辑
上一页 1 ··· 50 51 52 53 54 55 56 57 58 ··· 76 下一页