我在单击按钮的代码部分收到 System.NullReferenceException。我有问题WebBrowser1.Document.GetElementById("Giriş Yap").InvokeMember("click")
。同时我不是编码员,我在 web.xml 中找到了该代码。我想做自动 facebook 登录代码。
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Button1.Click
WebBrowser1.Navigate("https://www.facebook.com/")
End Sub
Private Sub Button2_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Button2.Click
WebBrowser1.Document.GetElementById("email").SetAttribute("value", TextBox1.Text)
WebBrowser1.Document.GetElementById("pass").SetAttribute("value", TextBox2.Text)
WebBrowser1.Document.GetElementById("Giriş Yap").InvokeMember("click")
End Sub
End Class