跟小D每日学口语
摘要: CSDN上看到别人提了这个问题,线程和控件调用冲突之类的见过不少,嵌套类没有试过,便尝试写下 1 public delegate void DoEvent(); 2 3 public partial class Form1 : Form 4 { 5 checkFlowThread td; 6 DoEvent toDo; 7 8 public Form1() 9 {10 InitializeComponent();11 toDo = new DoEvent(chec... 阅读全文
posted @ 2011-09-03 17:41 腐乳 阅读(466) 评论(0) 推荐(0)
摘要: 线程默认的ThreadStart委托只能使用void方法,但是Thread有个扩展委托ParameterizedThreadStart,可以传递object类型。比如下面这个: 1 publicstaticvoid ServerReceive(object parmas) 2 { 3 TcpParmater vals = parmas as TcpParmater; 4 IPAddress ServerIp = GetServerIP(); 5 IPEndPoint iep =new IPEndPoint(ServerIp, 10086); 6 socket =... 阅读全文
posted @ 2011-09-03 17:38 腐乳 阅读(672) 评论(0) 推荐(1)