Guest User

Untitled

a guest
Feb 19th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 2.36 KB | None | 0 0
  1. Public Class Form1
  2.  
  3.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  4.         dowork()
  5.     End Sub
  6.  
  7.     Sub dowork()
  8.         Try
  9.             Dim col As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("input")
  10.             For Each elem As HtmlElement In col
  11.                 If elem.GetAttribute("type").Contains("text") Then
  12.                     elem.SetAttribute("value", TextBox1.Text)
  13.                 End If
  14.             Next
  15.         Catch ex As Exception
  16.         End Try
  17.         Try
  18.             Dim col As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("input")
  19.             For Each elem As HtmlElement In col
  20.                 If elem.GetAttribute("type").Contains("password") Then
  21.                     elem.SetAttribute("value", TextBox2.Text)
  22.                 End If
  23.             Next
  24.         Catch ex As Exception
  25.         End Try
  26.         Threading.Thread.Sleep(50)
  27.         Try
  28.             Dim col As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("button")
  29.             For Each elem As HtmlElement In col
  30.                 If elem.GetAttribute("type").Contains("submit") Then
  31.                     elem.InvokeMember("click")
  32.                 End If
  33.             Next
  34.         Catch ex As Exception
  35.         End Try
  36.     End Sub
  37.  
  38.     Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
  39.         tweetdatshit()
  40.     End Sub
  41.  
  42.     Sub tweetdatshit()
  43.         Try
  44.             Dim col As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("textarea")
  45.             For Each elem As HtmlElement In col
  46.                 If elem.GetAttribute("classname").Contains("twitter-anywhere-tweet-box-editor") Then
  47.                     elem.SetAttribute("value", TextBox3.Text)
  48.                 End If
  49.             Next
  50.         Catch ex As Exception
  51.         End Try
  52.         Threading.Thread.Sleep(50)
  53.         Try
  54.             Dim col As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("a")
  55.             For Each elem As HtmlElement In col
  56.                 If elem.GetAttribute("classname").Contains("tweet-button button") Then
  57.                     elem.InvokeMember("click")
  58.                 End If
  59.             Next
  60.         Catch ex As Exception
  61.         End Try
  62.     End Sub
  63. End Class
Add Comment
Please, Sign In to add comment