posted @ 2017-08-20 00:30 清浅ヾ 阅读(351) 评论(0) 推荐(0)
摘要:
在windows窗体程序中,使用 ThreadException 事件来处理 UI 线程异常,使用 UnhandledException 事件来处理非 UI 线程异常。ThreadException可以阻止应用程序终止。具体使用方法如下: 阅读全文
摘要:
处理未捕获的异常是每个应用程序起码有的功能,C#在AppDomain提供了UnhandledException 事件来接收未捕获到的异常的通知。常见的应用如下: 阅读全文
posted @ 2017-08-20 00:28 清浅ヾ 阅读(188) 评论(0) 推荐(0)
摘要:
下面是一些Model类 1 class Student 2 { 3 public int id { get; set; } 4 public string name { get; set; } 5 public int age { get; set; } 6 } 7 8 class ClassStu 阅读全文
posted @ 2017-08-18 15:00 清浅ヾ 阅读(108) 评论(0) 推荐(0)
摘要:
上端主程序调用 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 6 namespace LinqToSql 7 { 8 class Program 9 { 阅读全文
posted @ 2017-08-18 09:58 清浅ヾ 阅读(140) 评论(0) 推荐(0)
摘要:
上端调用下端的实例 下面是几个类的实例 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 6 namespace 反射 7 { 8 class People< 阅读全文
posted @ 2017-08-18 07:33 清浅ヾ 阅读(133) 评论(0) 推荐(0)
摘要:
1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 6 namespace 缓存 7 { 8 class Program 9 { 10 static void Main(string[] args) 11 ... 阅读全文
posted @ 2017-08-16 18:33 清浅ヾ 阅读(309) 评论(0) 推荐(0)
摘要:
Monitor对象 1.Monitor.Enter(object)方法是获取锁,Monitor.Exit(object)方法是释放锁,这就是Monitor最常用的两个方法,当然在使用过程中为了避免获取锁之后因为异常,致锁无法释放,所以需要在try{} catch(){}之后的finally{}结构体 阅读全文
posted @ 2017-08-08 23:35 清浅ヾ 阅读(454) 评论(0) 推荐(0)
摘要:
1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 6 namespace 单例模式 7 { 8 class Studnet 9 { 10 public string id { get; set; } 11... 阅读全文
posted @ 2017-08-08 23:14 清浅ヾ 阅读(112) 评论(0) 推荐(0)
摘要:
1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Collections.Concurrent; //引用命名空间 6 using System.Threading; 7 using System.Di... 阅读全文
posted @ 2017-08-08 22:13 清浅ヾ 阅读(122) 评论(0) 推荐(0)
浙公网安备 33010602011771号