i just wanted to make a small bot using a web browser to post comments to wordpress blogs !
well i don't know the reason but it seems that only the last url is executed ! when i load a list and start the posting the loop seems to jump to the last url !
any help please ?
Thanks !
Imports
Public Class Form1
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If (TextBox4.Text = "") Then
MsgBox("load a list first")
Else
'StartPosition going throught the target.txt line by line
Dim sFileName As String
Dim srFileReader As System.IO.StreamReader
Dim sInputLine As String
sFileName = TextBox4.Text
srFileReader = System.IO.File.OpenText(sFileName)
sInputLine = srFileReader.ReadLine()
Do Until sInputLine Is Nothing
WebBrowser1.Navigate(sInputLine)
sInputLine = srFileReader.ReadLine()
Loop
MsgBox(WebBrowser1.DocumentTitle)
End If
End Sub
Private Sub RichTextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RichTextBox1.TextChanged
End Sub
Private Sub Button3_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
Private Sub BackgroundWorker1_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs)
End Sub
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
If (RadioButton1.Checked = True) Then
WebBrowser1.Document.GetElementById("name").SetAttribute("value", TextBox1.Text)
WebBrowser1.Document.GetElementById("email").SetAttribute("value", TextBox2.Text)
WebBrowser1.Document.GetElementById("url").SetAttribute("value", TextBox3.Text)
WebBrowser1.Document.GetElementById("words").SetAttribute("value", RichTextBox1.Text)
WebBrowser1.Document.GetElementById("submit").InvokeMember("click")
End If
If (RadioButton2.Checked = True) Then
WebBrowser1.Document.GetElementById("name").SetAttribute("value", TextBox1.Text)
WebBrowser1.Document.GetElementById("mail").SetAttribute("value", TextBox2.Text)
WebBrowser1.Document.GetElementById("website").SetAttribute("value", TextBox3.Text)
WebBrowser1.Document.GetElementById("comment").SetAttribute("value", RichTextBox1.Text)
WebBrowser1.Document.GetElementById("submit").InvokeMember("click")
End If
End Sub
Private Sub Button3_Click_2(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
OpenFileDialog1.InitialDirectory = "C:\"
OpenFileDialog1.ShowDialog()
TextBox4.Text = OpenFileDialog1.FileName
End Sub
Private Sub WebBrowser1_Navigated(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserNavigatedEventArgs) Handles WebBrowser1.Navigated
End Sub
End Class