Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
  2. thread = New System.Threading.Thread(AddressOf test)
  3. thread.Start()
  4. End Sub
  5.  
  6.  
  7.  
  8.  
  9. Delegate Sub varBR(ByVal wb As WebBrowser)
  10.  
  11.  
  12. Private Sub SetText(ByVal wb As WebBrowser)
  13.  
  14. ' InvokeRequired required compares the thread ID of the
  15. ' calling thread to the thread ID of the creating thread.
  16. ' If these threads are different, it returns true.
  17. If Me.WebBrowser2.InvokeRequired Then
  18. Dim d As New varBR(AddressOf SetText)
  19. Me.Invoke(d, New Object() {[wb]})
  20. Else
  21. 'Me.textBox1.Text = [text]
  22.  
  23. webbrowser2.ScriptErrorsSuppressed = True
  24. webbrowser2.Navigate("gmail.com")
  25.  
  26. Dim Username, Password As String
  27. Username = "abcd"
  28. Password = "efgh"
  29.  
  30. webbrowser2.Document.All("Email").SetAttribute("value", Username)
  31.  
  32.  
  33. webbrowser2.Document.All("next").InvokeMember("click")
  34. End If
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement