A preserved archive of the Logical Gamers community forums, 2009-2025. The original threads and posts, served read-only. Registration, posting and private messages are gone for good.

[Vb.net/VB8] What Am I doing wrong here...

2k views · started by Eternal Darkness ·
#1
[Vb.net/VB8] What Am I doing wrong here...
Public Class Form1
Public Wrapper As HTTPWrapper = New HTTPWrapper
Private Sub login_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles login.Click
Dim strHTML As String

If username.Text = vbNullString Or password.Text = vbNullString Then
MessageBox.Show("You left the username and/or password field blank." & vbNewLine & "Try again..")
Exit Sub
End If

username.Enabled = False
password.Enabled = False
login.Enabled = False

strHTML = Wrapper.GetWrapper("http://www.gaiaonline.com/auth/login/", "http://www.gaiaonline.com/")
strHTML = Wrapper.PostWrapper("http://www.gaiaonline.com/auth/login/", "username=" & username.Text & "&password=" & password.Text & "&token=390877768.1259031155.231727528&sid=&redirect=http%3A%2F%2Fwww.gaiaonline.com%2F&chap=2f23608d4e502e6f959acabe21950f74", "http://gaiaonline.com/")

If strHTML.Contains("Location: http://www.gaiaonline.com/?login_success=1") Then
MessageBox.Show("You are now Logged on...")
Else
MessageBox.Show("Login Failed...")

username.Enabled = True
password.Enabled = True
login.Enabled = True

End If
End Sub
End Class



Well I got the original from here :
[VB.NET] Gaia Login with WINSOCK - Gaming Gutter

Sorry about linking to gaming gutter but it was the only place I could find that gave me the information I needed for VB8...

I also edited because chad told me to...

He said he couldn't really help me, Can anyone help?
#2
Like i said, Timestamp doesn't matter. You need to get Frob and Token for the login to work else it wont.

Dim StrToken as String

StrToken = Wrapper.between (StrHTML, "token" & Chr(34) & " value=" & Chr(34), Chr(34))


there it's simple as that.
the wrapper.between is from a wrapper Alex made and I edited / fixed up a bit so it's going to be different on your .net wrapper.
#3
Chad wrote:
Like i said, Timestamp doesn't matter. You need to get Frob and Token for the login to work else it wont.


Dim StrToken as String

StrToken = Wrapper.between (StrHTML, "token" & Chr(34) & " value=" & Chr(34), Chr(34))


there it's simple as that.
the wrapper.between is from a wrapper Alex made and I edited / fixed up a bit so it's going to be different on your .net wrapper.


Well that doesn't tell me anything, sorry but it doesn't...

First off I need you to fix the code (Thats why I posted it) if you are going to tell me how to fix my code. I do not know where to put this code. I may be a N00b or whatever but this is how you learn...

Or could you tell me how to add the Wrapper.Between function to my wrapper... (And some possible other functions)

What is a Frob?
How would I find the token?
#4
Frob = SID
Sid = Session ID
Session ID = Temp ID used to tell who you are etc etc

Lesson #2 - you'll need a lot more programming experience to add functions to the wrapper.

Lesson #3 you would add the Frob were it says &Sid=
example
"&sid=" & strFrob & "The rest of the shit"

same goes with token
#5
Chad wrote:
Frob = SID
Sid = Session ID
Session ID = Temp ID used to tell who you are etc etc

Lesson #2 - you'll need a lot more programming experience to add functions to the wrapper.

Lesson #3 you would add the Frob were it says &Sid=
example
"&sid=" & strFrob & "The rest of the shit"

same goes with token


Thanks for the info...

Would it go?

...231727528&sid=[b]" & strFrob & "[/b]&redirect=http%3A%2F%2Fwww.gaiaonline.com%2F&...


Or something and what should I use for Token? Where should I put it?
#6
goes there just like that
but for the token take out all that shit he put in it. the numbers with the dots until you reach the equal sign.
#7
Chad wrote:
goes there just like that
but for the token take out all that shit he put in it. the numbers with the dots until you reach the equal sign.


"Name 'StrFrob' is not declared"

How do I fix this?
#8
Dim StrFrob as String
#9
Wouldnt he also need to make the password MD5?:O
#10
Bman wrote:
Wouldnt he also need to make the password MD5?:O


I thought so but Chad didn't tell me to do that yet...

Chad wrote:
Dim StrFrob as String


"Variable 'StrFrob' is used before it has been assigned a value. A null reference exception could result at runtime."
#11
I thought so but Chad didn't tell me to do that yet...



"Variable 'StrFrob' is used before it has been assigned a value. A null reference exception could result at runtime."


@Bman, the rolled back the need for the encryption so you don't need it anymore all you need is the session id and the token.

@Darkness, just rename it something else like Dim StrSid as string and use strsid
#12
Chad wrote:
@Bman, the rolled back the need for the encryption so you don't need it anymore all you need is the session id and the token.

@Darkness, just rename it something else like Dim StrSid as string and use strsid


Still the same error...

Cool...
#13
Copy and paste what you have. Just the login code.
#14
Chad wrote:
Copy and paste what you have. Just the login code.


There Ya Go:

Public Class Form1
Public Wrapper As HTTPWrapper = New HTTPWrapper
Private Sub login_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles login.Click
Dim strHTML As String
Dim StrSid As String

If username.Text = vbNullString Or password.Text = vbNullString Then
MessageBox.Show("You left the username and/or password field blank." & vbNewLine & "Try again..")
Exit Sub
End If

username.Enabled = False
password.Enabled = False
login.Enabled = False

strHTML = Wrapper.GetWrapper("http://www.gaiaonline.com/auth/login/", "http://www.gaiaonline.com/")
strHTML = Wrapper.PostWrapper("http://www.gaiaonline.com/auth/login/", "username=" & username.Text & "&password=" & password.Text & "&token=&sid=" & Strsid & "&redirect=http%3A%2F%2Fwww.gaiaonline.com%2F&chap=2f23608d4e502e6f959acabe21950f74", "http://gaiaonline.com/")

If strHTML.Contains("Location: http://www.gaiaonline.com/?login_success=1") Then
MessageBox.Show("You are now Logged on...")
Else
MessageBox.Show("Login Failed...")

username.Enabled = True
password.Enabled = True
login.Enabled = True

End If
End Sub
End Class
#15
Try this. I put all the errors in there and what you did wrong. By the way strSid isn't gonna get the Session for you it's self which you thought it would do. I gave you the code to do that but you never put it in your login code so heres the working code.

Public Class Form1
Public Wrapper As HTTPWrapper = New HTTPWrapper
Private Sub login_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles login.Click
Dim strHTML As String
Dim StrSid As String
Dim StrToken as String

'Problem was that you never had StrSid get your Session. I Spoon fed that
'code to you over a post.

If username.Text = vbNullString Or password.Text = vbNullString Then
MessageBox.Show("You left the username and/or password field blank." & vbNewLine & "Try again..")
Exit Sub
End If

username.Enabled = False
password.Enabled = False
login.Enabled = False

strHTML = Wrapper.GetWrapper("http://www.gaiaonline.com/auth/login/", "http://www.gaiaonline.com/")

'token" value="169726726.1259169363.730178551"
StrToken = GetStringBetween (StrHTML, "token" & Chr(34) & " value=" & Chr(34), Chr(34))

'name="sid" value=""
StrSid = GetStringBetween (StrHTML, "sid" & Chr(34) & " value=" & Chr(34), Chr(34))"

'Just so you know Chr(34) is the character quotes yes, " those
'Why did i say Chr(34)? So I don't have to use a damn character replacment


'The getstringbetween might be different in your vb.net wrapper

strHTML = Wrapper.PostWrapper("http://www.gaiaonline.com/auth/login/", "username=" & username.Text & "&password=" & password.Text & "&token=" & StrToken & "&sid=" & Strsid & "&redirect=http%3A%2F%2Fwww.gaiaonline.com%2F&chap=2f23608d4e502e6f959acabe21950f74", "http://gaiaonline.com/")

If strHTML.Contains("Location: http://www.gaiaonline.com/?login_success=1") Then
MessageBox.Show("You are now Logged on...")
Else
MessageBox.Show("Login Failed...")

username.Enabled = True
password.Enabled = True
login.Enabled = True

End If
End Sub
End Class


By the way i fixed it in notepad.
#16
Chad wrote:
Try this. I put all the errors in there and what you did wrong. By the way strSid isn't gonna get the Session for you it's self which you thought it would do. I gave you the code to do that but you never put it in your login code so heres the working code.


Public Class Form1
Public Wrapper As HTTPWrapper = New HTTPWrapper
Private Sub login_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles login.Click
Dim strHTML As String
Dim StrSid As String
Dim StrToken as String

'Problem was that you never had StrSid get your Session. I Spoon fed that
'code to you over a post.

If username.Text = vbNullString Or password.Text = vbNullString Then
MessageBox.Show("You left the username and/or password field blank." & vbNewLine & "Try again..")
Exit Sub
End If

username.Enabled = False
password.Enabled = False
login.Enabled = False

strHTML = Wrapper.GetWrapper("http://www.gaiaonline.com/auth/login/", "http://www.gaiaonline.com/")

'token" value="169726726.1259169363.730178551"
StrToken = GetStringBetween (StrHTML, "token" & Chr(34) & " value=" & Chr(34), Chr(34))

'name="sid" value=""
StrSid = GetStringBetween (StrHTML, "sid" & Chr(34) & " value=" & Chr(34), Chr(34))"

'Just so you know Chr(34) is the character quotes yes, " those
'Why did i say Chr(34)? So I don't have to use a damn character replacment


'The getstringbetween might be different in your vb.net wrapper

strHTML = Wrapper.PostWrapper("http://www.gaiaonline.com/auth/login/", "username=" & username.Text & "&password=" & password.Text & "&token=" & StrToken & "&sid=" & Strsid & "&redirect=http%3A%2F%2Fwww.gaiaonline.com%2F&chap=2f23608d4e502e6f959acabe21950f74", "http://gaiaonline.com/")

If strHTML.Contains("Location: http://www.gaiaonline.com/?login_success=1") Then
MessageBox.Show("You are now Logged on...")
Else
MessageBox.Show("Login Failed...")

username.Enabled = True
password.Enabled = True
login.Enabled = True

End If
End Sub
End Class


By the way i fixed it in notepad.


I put this code in, no errors or anything.

Public Class Form1
Public Wrapper As HTTPWrapper = New HTTPWrapper
Private Sub login_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles login.Click
Dim strHTML As String
Dim StrSid As String
Dim StrToken As String

'Problem was that you never had StrSid get your Session. I Spoon fed that
'code to you over a post.

If username.Text = vbNullString Or password.Text = vbNullString Then
MessageBox.Show("You left the username and/or password field blank." & vbNewLine & "Try again..")
Exit Sub
End If

username.Enabled = False
password.Enabled = False
login.Enabled = False

strHTML = Wrapper.GetWrapper("http://www.gaiaonline.com/auth/login/", "http://www.gaiaonline.com/")

'token" value="169726726.1259169363.730178551"
StrToken = GetStringBetween(StrHTML, "token" & Chr(34) & " value=" & Chr(34), Chr(34))

'name="sid" value=""
StrSid = GetStringBetween(strHTML, "sid" & Chr(34) & " value=" & Chr(34), Chr(34))

'Just so you know Chr(34) is the character quotes yes, " those
'Why did i say Chr(34)? So I don't have to use a damn character replacment

strHTML = Wrapper.PostWrapper("http://www.gaiaonline.com/auth/login/", "username=" & username.Text & "&password=" & password.Text & "&token=" & StrToken & "&sid=" & Strsid & "&redirect=http%3A%2F%2Fwww.gaiaonline.com%2F&chap=2f23608d4e502e6f959acabe21950f74", "http://gaiaonline.com/")

If strHTML.Contains("Location: http://www.gaiaonline.com/?login_success=1") Then
MessageBox.Show("You are now Logged on...")
Else
MessageBox.Show("Login Failed...")

username.Enabled = True
password.Enabled = True
login.Enabled = True

End If
End Sub
End Class


Then when I debug it still says login failed even though I know the login is correct...
#17
Who knows. Maybe it has captcha when you login. Put

If (Instr(1,StrHTML, "Can't read") Then
Msgbox.show ("Captcha")
Else
Msgbox.show ("No captcha")
End if

put this after the login or put it were the failed part is.
#18
Chad wrote:
Who knows. Maybe it has captcha when you login. Put

If (Instr(1,StrHTML, "Can't read") Then
Msgbox.show ("Captcha")
Else
Msgbox.show ("No captcha")
End if

put this after the login or put it were the failed part is.


Tried twice, First time it said Failed and No Captcha, then it said failed and Captcha...

Still doesn't work...

Public Class Form1
Public Wrapper As HTTPWrapper = New HTTPWrapper
Private Sub login_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles login.Click
Dim strHTML As String
Dim StrSid As String
Dim StrToken As String

'Problem was that you never had StrSid get your Session. I Spoon fed that
'code to you over a post.

If username.Text = vbNullString Or password.Text = vbNullString Then
MessageBox.Show("You left the username and/or password field blank." & vbNewLine & "Try again..")
Exit Sub
End If

username.Enabled = False
password.Enabled = False
login.Enabled = False

strHTML = Wrapper.GetWrapper("http://www.gaiaonline.com/auth/login/", "http://www.gaiaonline.com/")

'token" value="169726726.1259169363.730178551"
StrToken = GetStringBetween(StrHTML, "token" & Chr(34) & " value=" & Chr(34), Chr(34))

'name="sid" value=""
StrSid = GetStringBetween(strHTML, "sid" & Chr(34) & " value=" & Chr(34), Chr(34))

'Just so you know Chr(34) is the character quotes yes, " those
'Why did i say Chr(34)? So I don't have to use a damn character replacment

strHTML = Wrapper.PostWrapper("http://www.gaiaonline.com/auth/login/", "username=" & username.Text & "&password=" & password.Text & "&token=" & StrToken & "&sid=" & Strsid & "&redirect=http%3A%2F%2Fwww.gaiaonline.com%2F&chap=2f23608d4e502e6f959acabe21950f74", "http://gaiaonline.com/")

If strHTML.Contains("Location: http://www.gaiaonline.com/?login_success=1") Then
MessageBox.Show("You are now Logged on...")
Else
MessageBox.Show("Login Failed...")

If (InStr(1, strHTML, "Can't read")) Then
MsgBox("Captcha")
Else
MsgBox("No captcha")
End If

username.Enabled = True
password.Enabled = True
login.Enabled = True

End If
End Sub
End Class
#19
Wish i had my other computer to fix it but sense i'm not home i can't. Anyway, you can try to find or create your own encryption module if you want to try to encrypt the logins. Doubt it'll work but eh. Worth a shot. Ask Bman for it, doubt he has the one for vb.net.

Also, just to make sure after it attempts to login make it get gaiaonline and instead of location login success etc shit put if gold.gif then etc etc
#20
Chad wrote:
Wish i had my other computer to fix it but sense i'm not home i can't. Anyway, you can try to find or create your own encryption module if you want to try to encrypt the logins. Doubt it'll work but eh. Worth a shot. Ask Bman for it, doubt he has the one for vb.net.

Also, just to make sure after it attempts to login make it get gaiaonline and instead of location login success etc shit put if gold.gif then etc etc


Sorry, I think I will wait for you to get home...

I would rather have you help me re-code it... I don't mind the wait...

Sorry if I am troubling you by this....

I will ask B man though and if he sends me something I will post it here....
#21
Well, i'd try to figure it out because i wont be home for at least another 3 days. or you could just recode it in vb6 which is easier.
#22
Chad wrote:
Well, i'd try to figure it out because i wont be home for at least another 3 days. or you could just recode it in vb6 which is easier.


I don't like vb6...

I will try to code it but no promises... I will use your help when you can help me whenever that is...


EDIT: Why won't this work in my http wrapper?

Winsock1.Close()


"InvalidComObjectExeption was unhanded"
#23
Thats just saying that winsock closed before it was suppose to or it failed to close, wouldn't matter really sense you are closing the program.
#24
Chad wrote:
Thats just saying that winsock closed before it was suppose to or it failed to close, wouldn't matter really sense you are closing the program.


It says thats a problem... Is it?
#25
Well, the program will continue to run in the background (check your task manager. Processes)

Thats all that will happen. It wont do anything besides sit there.
#26
What you could do to make sure it ends is go to Form_unloadQuery or what ever and put End in it or Unload Me
#27
Chad wrote:
What you could do to make sure it ends is go to Form_unloadQuery or what ever and put End in it or Unload Me


What? Where?
#28
You have to find it from that thing, click the form and it should have some drop down menus at the top saying what things you have like form command button etc and to the right of that it should say for form
unload
activate or load
queary unload and some other stuff
#29
Chad wrote:
You have to find it from that thing, click the form and it should have some drop down menus at the top saying what things you have like form command button etc and to the right of that it should say for form
unload
activate or load
queary unload and some other stuff


Should I put it right above the login like so?

Public Class Form1
Public Wrapper As HTTPWrapper = New HTTPWrapper
Private Sub login_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles login.Click
Dim strHTML As String
Dim StrSid As String
Dim StrToken As String

'Problem was that you never had StrSid get your Session. I Spoon fed that
'code to you over a post.

If username.Text = vbNullString Or password.Text = vbNullString Then
MessageBox.Show("You left the username and/or password field blank." & vbNewLine & "Try again..")
Exit Sub
End If

username.Enabled = False
password.Enabled = False
login.Enabled = False

Form_unloadQuery
Unload.Me
End

strHTML = Wrapper.GetWrapper("http://www.gaiaonline.com/auth/login/", "http://www.gaiaonline.com/")

'token" value ="169726726.1259169363.730178551"
StrToken = GetStringBetween(strHTML, "token" & "Chr(34)" & " value=" & "Chr(34)", "Chr(34))")

'name="sid" value=""
StrSid = GetStringBetween(strHTML, "sid" & "Chr(34)" & " value=" & "Chr(34)", "Chr(34)")

'Just so you know Chr(34) is the character quotes yes, " those
'Why did i say Chr(34)? So I don't have to use a damn character replacment

strHTML = Wrapper.PostWrapper("http://www.gaiaonline.com/auth/login/", "username=" & username.Text & "&password=" & password.Text & "&token=" & StrToken & "&sid=" & Strsid & "&redirect=http%3A%2F%2Fwww.gaiaonline.com%2F&chap=2f23608d4e502e6f959acabe21950f74", "http://gaiaonline.com/")

If strHTML.Contains("Location: http://www.gaiaonline.com/?login_success=1") Then
MessageBox.Show("You are now Logged on...")
Else
MessageBox.Show("Login Failed...")

If (InStr(1, strHTML, "Can't read")) Then
MessageBox.Show("Captcha")
Else
MessageBox.Show("No captcha")
End If

username.Enabled = True
password.Enabled = True
login.Enabled = True

End If
End Sub
End Class
#30
Dude, you don't have to do it. You can if you want. If you don't do it, it will do nothing but sit in the background doing nothing until you end it via task manager. It's not that big of a deal.
#31
Chad wrote:
Dude, you don't have to do it. You can if you want. If you don't do it, it will do nothing but sit in the background doing nothing until you end it via task manager. It's not that big of a deal.


Oh I see. I thought it had something to do with the Login XD...

Sounded like unloading the data for a login or something like that... My Bad...



Edit:

Are the values like:

'name="sid" value=""


Supposed to be inactive (Have the ')... Because I have tried everything and it says value is not declared...