Loop Only Runs In MessageBox
Guys, I have the most retarded problem ever...the thing is, I have this loop, and it runs just fine(except for the boringness) if I use Msgbox("whatever") after some of its lines, but it won't run otherwise...I guess it has to do with the time my local server takes to awnser, but I tried System.Threading.Thread.Sleep() up to 10000 and nothing worked...even tough it did on msgbox's which I went trough faster than those.
Also, how can I clean Webbrowser1 cookie's?
Here is the code, if you guys can help.
Thanks in advance.
Also, how can I clean Webbrowser1 cookie's?
Here is the code, if you guys can help.
Code:
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim FILE_NAME As String = "C:\Users\Myname\Desktop\list.txt"
Dim TextLine As String
Me.Visible = True
Dim ia As Integer
ia = 0
Dim lol As String
If System****.File.Exists(FILE_NAME) = True Then
Dim objReader As New System****.StreamReader(FILE_NAME)
Do While objReader.Peek() <> -1
WebBrowser1.Navigate("http://localhost/bf/login.php")
MsgBox("as")
WebBrowser1.Document.GetElementById("user").SetAttribute("value", "bacon")
ia += 1
TextLine = objReader.ReadLine() & vbNewLine
TextBox1.Text = TextLine
WebBrowser1.Document.GetElementById("pass").SetAttribute("value", TextBox1.Text)
MsgBox("as")
WebBrowser1.Document.GetElementById("subm").Focus()
MsgBox("as")
WebBrowser1.Document.GetElementById("subm").InvokeMember("click")
MsgBox("as")
lol = WebBrowser1.Url.ToString
If lol = "http://localhost/bf/done.php" Then
MsgBox("Done at try number " & ia & " Password is: " & TextBox1.Text)
Exit Do
Else
End If
Loop
Else
MsgBox("File Does Not Exist")
End If
End Sub
End Class