PHP Login Via VB.Net

Posts 1–9 of 9 · Page 1 of 1
PHP Login Via VB.Net
I'm trying to create a login thing to login through PHP with VB.Net as below, it fills out the forms on the web page with the text and logs it in, but I get no errors and it just doesn't log in, it just gives me the 'Login failed...' message I set. =/
[highlight=vb.net]
Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
WebBrowser1.Document.GetElementById("user").SetAtt ribute("value", (TextBox1.Text))
WebBrowser1.Document.GetElementById("passwrd").Set Attribute("value", (TextBox2.Text))
WebBrowser1.Document.GetElementById("login_btn").I nvokeMember("click")
Threading.Thread.Sleep(4000)
If WebBrowser1.Url.AbsolutePath = "(Outside Link Cannot Be Posted)" Then
MsgBox("Successfully logged in")
Me.Hide()
Loader.Show()
Else
MsgBox("Login failed...")
End If
End Sub
[/highlight]
[highlight=vb]If WebBrowser1.Url.AbsolutePath = "(Outside Link Cannot Be Posted)" Then[/highlight]

wtf ? How can be (Outside Link Cannot Be Posted) an AbsolutePath ever ?
Try WebBrowser1.Document.Body.InnerText.Contains("Outs ide Link Cannot Be Posted")

or something like that, instead of AbsolutePath.
Quote Originally Posted by Jason View Post
Try WebBrowser1.Document.Body.InnerText.Contains("Outs ide Link Cannot Be Posted")

or something like that, instead of AbsolutePath.
I tried it, didn't work, so then I tried it so that if it doesn't contain 'Forgot your password?' then it would be a successful login, still nada.

=/
Quote Originally Posted by Jason View Post
Try WebBrowser1.Document.Body.InnerText.Contains("Outs ide Link Cannot Be Posted")

or something like that, instead of AbsolutePath.
the term "inner text" isnt correct. It just finds the text within the web URL
Quote Originally Posted by kBob View Post
the term "inner text" isnt correct. It just finds the text within the web URL
Actually you're completely incorrect lol.
Mind telling what website you're trying?
Quote Originally Posted by master131 View Post
Mind telling what website you're trying?
One that I made, course I can't post it due to the outside link rule.
Perhaps try InnerHTML instead of InnerText.
Posts 1–9 of 9 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us