01 2020 档案
摘要:public static class StringHelper { public static bool IsCapitalized(this string str) { if(string.IsNullOrWhiteSpace(str)) { return false; } return cha
阅读全文
摘要:static void AggregateExceptionsDemo() { var task1 = Task.Factory.StartNew(() => { var child1 = Task.Factory.StartNew(() => { throw new CustomException
阅读全文
摘要:Below is applicable for ConsoleApplication 1.Install-package MouseKeyHook 2. using Gma.System.MouseKeyHook; using System; namespace ConsoleApp1 { publ
阅读全文
摘要:using System; using System.Windows.Forms; using System.Runtime.InteropServices; using System.Diagnostics; namespace ConsoleApplication3 { class Monito
阅读全文
摘要:1 static DataTable ConvertJsonToTable(string jsonValue) 2 { 3 DataTable dt = (DataTable)JsonConvert.DeserializeObject(jsonValue, typeof(DataTable)); 4
阅读全文
摘要:1.Git Delete remote branch git push origin --delete remoteBranchName eg:git push origin --delete MyFirstRemoteBranch 2.Generate pub key. ssh-keygen -t
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:I had validated that different encoding mode can generate different result,they are not identical. Besides,the File.ReadAllBytes may based on UTF8 bec
阅读全文