摘要: ·关于C#中timer类在C#里关于定时器类就有3个1.定义在System.Windows.Forms里2.定义在System.Threading.Timer类里3.定义在System.Timers.Timer类里System.Windows.Forms.Timer是应用于WinForm中的,它是通过Windows消息机制实现的,类似于VB或Delphi中的Timer控件,内部使用APISetTimer实现的。它的主要缺点是计时不精确,而且必须有消息循环,ConsoleApplication(控制台应用程序)无法使用。System.Timers.Timer和System.Thread 阅读全文
posted @ 2011-11-28 16:20 PointNet 阅读(3462) 评论(1) 推荐(0) 编辑
摘要: 不需要传递参数,也不需要返回参数 我们知道启动一个线程最直观的办法是使用Thread类,具体步骤如下:ThreadStart threadStart=new ThreadStart(Calculate);Threadthread=newThread(threadStart);thread.Start();publicvoidCalculate() { doubleDiameter=0.5; Console.Write("TheAreaOfCirclewithaDiameterof{0}is{1}"Diameter,Diameter*Math.PI);} 上面我们用定义了一个 阅读全文
posted @ 2011-11-28 14:33 PointNet 阅读(638) 评论(0) 推荐(0) 编辑