随笔分类 - C# 基础
摘要:string ControllerInfo = ViewContext.RouteData.Values["controller"].ToString(); string Action = ViewContext.RouteData.Values["action"].ToString();
阅读全文
摘要:方法中调用了其它dll没有做异常捕获的处理的方法,即使在本代码用使用try,cath做异常捕获,这样也捕获不了, 此时需要在本方法头上使用如下引用即可捕获到异常:
阅读全文
摘要:staticvoid Main(string[] args) { string s =""; //(1)字符访问(下标访问s[i]) s ="ABCD"; Console.WriteLine(s[0]); // 输出"A"; Console.WriteLine(s.Length...
阅读全文
摘要:var content = new StreamReader(@"D:\json.txt", Encoding.Default).ReadToEnd();
阅读全文
摘要:using Newtonsoft.Json.Converters; using Newtonsoft.Json; IsoDateTimeConverter timeFormat = new IsoDateTimeConverter(); timeFormat.DateTimeFormat = "yyyy-MM-dd HH:mm:ss"; JsonConvert.SerializeObje...
阅读全文
摘要:System.Diagnostics.Stopwatch stopwatch = new Stopwatch(); stopwatch.Start(); //执行代码+++ var d = stopwatch.Elapsed.Seconds; stopwatch.Stop();
阅读全文
摘要:private static char[] constant = { '0','1','2','3','4','5','6','7','8','9', 'A','B','C','D','E','F','G','H','I','J','K','L',
阅读全文

浙公网安备 33010602011771号