Info: This is a method of logging into Gaia with out touching the WebBroswer in the Form, but rather using data entered or stored.
PART 1
First i'm going to use Text Boxes.
1. First make a form and include
-Webbroswer
-2 Text Boxes
-Button
2. Enter this code for the Button.
This for form load.Code:Dim user As String Dim pass As String user = Me.TextBox1.Text pass = Me.TextBox2.Text Me.WebBrowser1.Document.GetElementsByTagName("Input").Item(0).SetAttribute("Value", user) Me.WebBrowser1.Document.GetElementsByTagName("Input").Item(1).SetAttribute("Value", pass) Me.WebBrowser1.Document.All("signInButton").InvokeMember("click")
3. Now first text-box will send the username to Gaia, the second is for the password. Use the button to submit and it will login thanks to this piece of code.Code:Me.WebBrowser1.Navigate("http://www.gaiaonline.com")
Now, "signInButton" is what the Login button for Gaia is called. The code above looks for that element and clicks it to submit.Code:Me.WebBrowser1.Document.All("signInButton").InvokeMember("click")
PART 2
Using Input Boxes
So delete your text boxes. All you need in the form is a single Webbroswer.
So change the code.
(Form1_Load)
Now what has changed in this is that you are receiving Login Details from Input boxes instead of text boxes.Code:Me.WebBrowser1.Navigate("http://gaiaonline.com") Dim user As String Dim pass As String user = InputBox("GaiaOnline Username", "Username") pass = InputBox("Gaiaonline Password", "Password") Me.WebBrowser1.Document.GetElementsByTagName("Input").Item(0).SetAttribute("Value", user) Me.WebBrowser1.Document.GetElementsByTagName("Input").Item(1).SetAttribute("Value", pass) Me.WebBrowser1.Document.All("signInButton").InvokeMember("click")
So no need for the code in a button, juts put it all in the form Load. So when the second input box is submitted it will activate the form load and use the collected data form the input boxes istead of using the text boxes.Code:user = InputBox("GaiaOnline Username", "Username") pass = InputBox("Gaiaonline Password", "Password")
~iShellz
+rep pl0x
Results 1 to 3 of 3
- 09 Sep. 2010 01:08am #1
[Visual Basic] Login to Gaia with Windows Forms
Last edited by Shell; 09 Sep. 2010 at 09:35pm.
- 09 Sep. 2010 06:49am #2
- Age
- 29
- Join Date
- Aug. 2010
- Location
- In Your FRIDGE with a laptop :)
- Posts
- 1,360
- Reputation
- 89
- LCash
- 0.00
omg thank you so much i needed this xD but i need halp with other stuff too GET AWNLINE
"I try to contribute hopefully im doing my job. " :0,
+rep me if you like the pics i draw for you?
Looks like we got ourselves our own ghetto LG chat room
Anyone want an RS account? Add me Pl0x
MSN: sonic_benny@yahoo.com
- 09 Sep. 2010 03:20pm #3
I thought you would find this useful.