vb.net gaia login
2.2k views · started by Chad ·
Thanks a lot Chad!
Could you post the code for it? I don't have any VB.net editor, and I don't feel like installing it for a small section of code. I wanna convert it to PHP.
Public Class frmMain
Dim StrHTML As String
Dim StrToken As String
Dim StrFrob As String
Private Sub cmdLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdLogin.Click
If (txtUsername.Text = (vbNullString) Or txtPassword.Text = (vbNullString)) Then
MessageBox.Show("Please enter a username and or password", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information)
Exit Sub
End If
cmdLogin.Enabled = False
txtUsername.Enabled = False
txtPassword.Enabled = False
StrHTML = Wrapper.GetWrapper("http://www.gaiaonline.com/", "http://www.google.com/")
StrToken = GetStringBetween(StrHTML, "name=""token"" value=""", """")
StrFrob = GetStringBetween(StrHTML, "name=""frob"" value=""", """")
'MsgBox(StrToken & ":" & StrFrob)
StrHTML = Wrapper.PostWrapper("http://www.gaiaonline.com/auth/login", "token=" & StrToken & "&sid=&frob=" & StrFrob & "&toolbar_id=&redirect=http%3A%2F%2Fwww.gaiaonline.com%2F&username=" & txtUsername.Text & "&password=" & txtPassword.Text & "&chap=", "http://gaiaonline.com/")
SecondsToWait(1)
If (InStr(1, StrHTML, "?login_success=1")) Then
MessageBox.Show(txtUsername.Text & " : Has logged in!", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information)
Else
MessageBox.Show("Failed to login", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information)
txtUsername.Enabled = True
txtPassword.Enabled = True
cmdLogin.Enabled = True
End If
End Sub
End ClassDoes this work, or is it an example of old code? I thought a CHAP key was required.
Its a new code. Coded by me. It works perfectly.
You also need the wrapper files to use it. :p
Right my bad, didn't see they were included in the first post download.
Chad wrote:
Public Class frmMain
Dim StrHTML As String
Dim StrToken As String
Dim StrFrob As String
Private Sub cmdLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdLogin.Click
If (txtUsername.Text = (vbNullString) Or txtPassword.Text = (vbNullString)) Then
MessageBox.Show("Please enter a username and or password", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information)
Exit Sub
End If
cmdLogin.Enabled = False
txtUsername.Enabled = False
txtPassword.Enabled = False
StrHTML = Wrapper.GetWrapper("http://www.gaiaonline.com/", "http://www.google.com/")
StrToken = GetStringBetween(StrHTML, "name=""token"" value=""", """")
StrFrob = GetStringBetween(StrHTML, "name=""frob"" value=""", """")
'MsgBox(StrToken & ":" & StrFrob)
StrHTML = Wrapper.PostWrapper("http://www.gaiaonline.com/auth/login", "token=" & StrToken & "&sid=&frob=" & StrFrob & "&toolbar_id=&redirect=http%3A%2F%2Fwww.gaiaonline.com%2F&username=" & txtUsername.Text & "&password=" & txtPassword.Text & "&chap=", "http://gaiaonline.com/")
SecondsToWait(1)
If (InStr(1, StrHTML, "?login_success=1")) Then
MessageBox.Show(txtUsername.Text & " : Has logged in!", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information)
Else
MessageBox.Show("Failed to login", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information)
txtUsername.Enabled = True
txtPassword.Enabled = True
cmdLogin.Enabled = True
End If
End Sub
End Class
This actually doesnt work. And you didnt code this from scratch. This is old. And gaia updated there login so "If (InStr(1, StrHTML, "?login_success=1")) Then" wont work. Also, this is VB6, not VB.net
Due to a technicality, login_success=1 will work. The difference is they put a timestamp instead of 1, but most timestamps start with 1 (until a good many years into the future). As long as it doesn't check to see if the URL ends with login_success=1, InStr() will work.
GAMEchief wrote:Due to a technicality, login_success=1 will work. The difference is they put a timestamp instead of 1, but most timestamps start with 1 (until a good many years into the future). As long as it doesn't check to see if the URL ends with login_success=1, InStr() will work.
I am a beginner coder but I think Gamechief is right...
I downloaded it, ran it and it works Sk8ter...
I think the code basically searches for "login_success=1" in the url after it sends the data.
The time stamp is irrelevant, it comes after the "login_success=1", so as long as the url contains "login_success=1" it will say that it was a success and log you in... It will still have the time stamp from Gaia's Viewpoint....
Sk8er wrote:This actually doesnt work. And you didnt code this from scratch. This is old. And gaia updated there login so "If (InStr(1, StrHTML, "?login_success=1")) Then" wont work. Also, this is VB6, not VB.net
vb6 and vb.net wrappers are the same, just ported it over. and yes it works considering the Time stamp doesn't have to be in it. Test it if you want.
Eternal Darkness wrote:I am a beginner coder but I think Gamechief is right...
I downloaded it, ran it and it works Sk8ter...
I think the code basically searches for "login_success=1" in the url after it sends the data.
The time stamp is irrelevant, it comes after the "login_success=1", so as long as the url contains "login_success=1" it will say that it was a success and log you in... It will still have the time stamp from Gaia's Viewpoint....
Actually, the 1 is part of the timestamp. I don't feel like calculating how long it will take, but I'm going to guess and say in 3 years, for example, that the timestamp will start with 2 (login_success=2...), and the code would no longer work
GAMEchief wrote:Actually, the 1 is part of the timestamp. I don't feel like calculating how long it will take, but I'm going to guess and say in 3 years, for example, that the timestamp will start with 2 (login_success=2...), and the code would no longer work
Well then can we put login_success=2? or no?
Ok, thanks for the info on timestamps...
To be honest you don't even need a 1 or a 2 for it. just the =
Chad wrote:To be honest you don't even need a 1 or a 2 for it. just the =
I thought so too. It just searches for the "login_success=1" in the Url and if it shows up you know you have logged in. Correct?
Because then it could be without the 1 or just "_success". Right?
These codes should work because there is now a "http://www.g aiaonline.com/auth/login/" if the information you put in is incorrect...