摘要:static void AggregateExceptionsDemo() { var task1 = Task.Factory.StartNew(() => { var child1 = Task.Factory.StartNew(() => { throw new CustomException 阅读全文
posted @ 2020-01-19 23:38 Fred1987 阅读 (20) 评论 (0) 编辑
摘要:1.Install-package MouseKeyHook 2. using Gma.System.MouseKeyHook; using System; namespace ConsoleApp1 { public class MonitorHelper { public static void 阅读全文
posted @ 2020-01-15 17:26 Fred1987 阅读 (30) 评论 (0) 编辑
摘要:using System; using System.Windows.Forms; using System.Runtime.InteropServices; using System.Diagnostics; namespace ConsoleApplication3 { class Monito 阅读全文
posted @ 2020-01-15 11:23 Fred1987 阅读 (36) 评论 (0) 编辑
摘要:1 static DataTable ConvertJsonToTable(string jsonValue) 2 { 3 DataTable dt = (DataTable)JsonConvert.DeserializeObject(jsonValue, typeof(DataTable)); 4 阅读全文
posted @ 2020-01-14 18:18 Fred1987 阅读 (83) 评论 (0) 编辑
摘要:1.Git Delete remote branch git push origin --delete remoteBranchName eg:git push origin --delete MyFirstRemoteBranch 2.Generate pub key. ssh-keygen -t 阅读全文
posted @ 2020-01-13 11:14 Fred1987 阅读 (5) 评论 (0) 编辑
摘要:using System.IO; using System.Diagnostics; static void Main(string[] args) { CmdDemo("dir"); Console.ReadLine(); } static void CmdDemo(string cmdText) { var proc = new Process { StartInfo = new Proces 阅读全文
posted @ 2020-01-06 11:16 Fred1987 阅读 (41) 评论 (0) 编辑
摘要:static void Main(string[] args) { string[] enumNames = GetEnumNames(typeof(Seasons)); if(enumNames!=null && enumNames.Any()) { foreach(var name in enumNames) { Console.WriteLine(name); } } Console.Wri 阅读全文
posted @ 2020-01-03 14:59 Fred1987 阅读 (76) 评论 (0) 编辑
摘要:1.install-package log4net 2.add new config file, its name is log4net.config <?xml version="1.0" encoding="utf-8" ?><configuration> <log4net> <root> <l 阅读全文
posted @ 2020-01-03 11:29 Fred1987 阅读 (96) 评论 (0) 编辑
摘要:I had validated that different encoding mode can generate different result,they are not identical. Besides,the File.ReadAllBytes may based on UTF8 bec 阅读全文
posted @ 2020-01-01 21:17 Fred1987 阅读 (24) 评论 (0) 编辑
摘要:static void Main(string[] args) { WebClientDemo(); Console.ReadLine(); } static void WebClientDemo() { webContent = File.ReadAllText("img2.txt"); var urlsList = webContent.Split(new string[] { "\"", " 阅读全文
posted @ 2019-12-30 09:44 Fred1987 阅读 (28) 评论 (0) 编辑