help to login to that website

ben313100

New member
Joined
Aug 8, 2018
Messages
2
Programming Experience
Beginner
hey guys i am new here just a beginner in vb.net i have a question i made a login form for a browser game but i am stuck on how to go forward to seconde load game .. vb.net web-game (www.darkorbit.com) username =strikerII password = 1236987

windows form application with :

2 textbox
1 web-browser
3 buttons

Public Class Form1
Dim didWeNavigated? As Boolean = False
Dim gottheserver? As Boolean = False


Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
WebBrowser1.Navigate("http://www.darkorbit.com")
didWeNavigated = True
End Sub


Private Sub WebBrowser1_DocumentCompleted(sender As Object, e As WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
If didWeNavigated = False Then
Exit Sub
End If
If didWeNavigated = True Then didWeNavigated = False
Dim username As String = TextBox1.Text
Dim password As String = TextBox2.Text
WebBrowser1.Document.GetElementById("bgcdw_login_form_username").SetAttribute("Value", username)
WebBrowser1.Document.GetElementById("bgcdw_login_form_password").SetAttribute("Value", password)
Dim Html As HtmlElement
For Each Html In WebBrowser1.Document.GetElementsByTagName("input")
If Html.GetAttribute("type") = "submit" Then
Html.InvokeMember("Click")
End If
Next
End Sub

*****till here all work fine ******


Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button3.Click
WebBrowser1.Document.GetElementById("header_start_btn").InvokeMember("click")

End Sub
?*****the problem is here when i click button 2 it popup I.E page with error and i want to popup in the same web-browser1
dunno how to make it i tried to find in google but nothing*******



?


Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
Me.Close()
End Sub
End Class

any idea ??!!!
best regards
 

ben313100

New member
Joined
Aug 8, 2018
Messages
2
Programming Experience
Beginner
even with
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
If WebBrowser1.Url.ToString = "https://fr1.darkorbit.com/indexInternal.es?action=internalStart&prc=100" Then
WebBrowser1.Navigate("https://fr1.darkorbit.com/indexInternal.es?action=internalMapRevolution")
End If
and still not working
 
Top Bottom