1,為什么 TIMER_Tick 方法定義時(shí)候沒有參數(shù),在Form1中引用是卻是 TIMER_Tick(null,null) ?2,就算TIMER_Tick是 定時(shí)器的一個(gè)計(jì)數(shù)器,也應(yīng)該是ProcessTimer吧 名字都不對(duì)是怎么回事!求解答public Form1(bool noGAC){ProcessTimer = new System.Threading.Timer(new System.Threading.TimerCallback(OnProcessUpdate), null, 0, 5000);TIMER_Tick(null, null);}private static void OnProcessUpdate(Object InCallback){ProcessTimer.Change(Timeout.Infinite, Timeout.Infinite);try{//代碼1}catch (AccessViolationException){}finally{ProcessTimer.Change(5000, 5000);}}private void TIMER_Tick(object sender, EventArgs e){TIMER.Stop();try{//代碼2}finally{TIMER.Start();}}
如下,我省略了一些具體代碼,對(duì)結(jié)構(gòu)中的一些語句有疑問:
料青山看我應(yīng)如是
2022-06-15 15:11:22