所以我有这个脚本通过WebBrowser工具上的网页填写某些表单。它需要填写这些表格500秒,然后做我指定的任何事情。我可以做些什么来使脚本在visual basic上运行500秒?
答案 0 :(得分:3)
使用Timer
控件,如下所示:
Timer
控件从工具箱拖放到表单上。假设您正在执行此操作以响应按钮单击,如下所示:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Interval = 500000
Timer1.Enabled = True
Timer1.Start()
End Sub
Private Sub TimerEventProcessor(myObject As Object, ByVal myEventArgs As EventArgs) Handles Timer1.Tick
Timer1.Stop()
' Do something to indicate the timer is up, message, etc. or start a new timer, etc.
End Sub