当前位置: 代码迷 >> C# >> ,挺急的。c#中timer的用法
  详细解决方案

,挺急的。c#中timer的用法

热度:88   发布时间:2016-05-05 04:57:32.0
在线等 ,挺急的。c#中timer的用法

class Program
    {
        static int count = 0;
        static void Main(string[] args)
        {


            System.Threading.Timer tmr = new System.Threading.Timer(Tick, count, 5000, 1000);
            Console.ReadLine();
            tmr.Dispose();
            
        }


         static void Tick(object data)
        {
       。。。。。。。。。。。省略
       }


这段代码为什么运行不到 Tick()中啊 ,每次都是main函数运行了就结束了
------解决思路----------------------
 System.Threading.Timer timer = new System.Threading.Timer(new System.Threading.TimerCallback(Tick), null,0,1000);
  相关解决方案