我无法弄清楚如何使系统等待10秒而不让他进入睡眠状态(我想让timer2等待10秒后再开始工作。我试过System.Threading.Thread.Sleep (10000)但是这段代码使所有应用程序都变得轻松。 这是来自timer2的代码
Private Sub Timer2_Tick(sender As Object, e As EventArgs) Handles Timer2.Tick '1214x727 Dim procinstall As Boolean = Process.GetProcesses().Any(Function(p) p.ProcessName.Contains("ErrorFixer")) If procinstall = True Then SetCursorPos(1214, 727) mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0) 'Invoke mouse down event mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0) 'Invoke mouse up event mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0) 'Invoke mouse down event mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0) 'Invoke mouse up event Timer2.Stop() Label3.Text = "Installing" End If End Sub
如果procinstall = True那么,我想把那段代码等到光标移到那个位置然后鼠标点击。
感谢。