0
我首次使用VB。我不知道,爲什麼這個簡單的代碼不起作用。VB 2010 sendkeys錯誤
Imports System.Runtime.InteropServices
Public Class Form1
Private Sub Button2_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Application.Exit()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim ProcID As Integer
ProcID = 2940
AppActivate(ProcID)
SendKeys.SendWait("Username")
SendKeys.SendWait("{ENTER}")
SendKeys.SendWait("Password")
SendKeys.SendWait("{ENTER}")
End Sub
End Class
在這行做此異常出現? –
第一個SendKeys行 – V0lvox337
你有沒有試過My.Computer.Keyboard.SendKey? –