方法调用计时器 [英] method call timer

查看:132
本文介绍了方法调用计时器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

调用特定方法后该如何做-正在等待时间?让我们转到第5分钟已等待很远的电话,过渡到另一页的方法正在等待另外2分钟.使用thread.sleep(30000).但是当您调用此方法时, 应用程序挂起,必须等到时间.事件timer_Tick处理1个方法.使用不方便,并且订阅许多事件timer_Tick也不方便.

How to do that after calling a particular method-was waiting the time? Let's go to page 5 minutes have waited far call the method of transition to another page are waiting for another 2 minutes. Use thread.sleep (30000). But when you call this method, the application hangs and have to wait until time. Event timer_Tick handles 1 method. use is not convenient, and subscribe to many events timer_Tick doesn't conveniently. be like?

推荐答案

时间到期后如何调用方法
     
How to call a method after the expiration of time
     
public void tMetro(string url)
              {
                  tm.Stop();
                  tm.Interval = 5000;
                  tm.Start();
                  method_8(url, "");
                  if (wb.Url.AbsoluteUri == url)
                      wb.Stop();
              }

但不是Timer_tick
     

But not in the event Timer_tick
     

private void timer1_Tick(object sender, EventArgs e)
            {
                tm.Stop();
                wb.Stop();
            }

已尝试通过"Thread.Sleep()"应用程序冻结
不知道该怎么做.需要您的帮助

Have tried through the `Thread.Sleep()` application freezes
Do not know how to be. Need your help


这篇关于方法调用计时器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆