GameCheetah

Go Back   GameCheetah > Coding > Programming > Programming Tutorials

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-04-2008, 03:42 PM
Bllacke's Avatar
Alumnus
 
Join Date: Nov 2008
Location: Virginia
Posts: 1,425
Thanks: 45
Thanked 74 Times in 50 Posts
My Mood:
Rep Power: 11
Total Rep: 589
Default [VB.NET] Gaia Login with WINSOCK

will teach you how to make a gaia online login using VB.NET. I currently have VB2008 installed so that is what I will use for this tut. If you have VB2005 or 2003 then some of the directions might be different.
Ok, firstly download this wrapper and just leave it for now.
Open VB, then go to File -> New Project. Select Windows Forms Application and name it whatever you want, I'll name mine GaiaLoginExamp.


Now a form should appear and on the left side you should see a box called 'Toolbox'. Select textbox and make two. Under them make one button.


Now you have to name the stuff. Name the first textbox username. Name the second textbox password. And name the button Login, also if you want you can change the text for the button to something like Login.

Double click on the button and code should appear.


Save everything and if you are using VB2008 a box should appear. Remember the location, copy it and go to the folder. And of course click save.

If you're in the folder right now then get the wrapper and unzip it in the folder called GaiaLoginExamp or whatever you named your project as.


Go back to visual studio and go to Project -> Add Reference. Click browse and you should see 5 .dlls. Select them all and click Ok.


Now we need to include the wrapper files, go to Project -> Add Existing Item.. You need to select 5 files and they are; Sleepmodule.vb, Stuff.vb, wrapper.designer.vb, wrapper.resx, wrapper.vb. When you selected these click add. We have setup the wrapper, now we just need to declare it and write the code.


Under "Public Class Form1" write this; Public Wrapper As HTTPWrapper = New HTTPWrapper
This declares that 'wrapper' is using the class HTTPWrapper. So now we can use the wrapper fully.


Now we can write the code for the login because we set up the wrapper. Under 'Private Sub Login_Click', paste this code

Code: Select
'This declares the strHTML as a string
        Dim strHTML As String

        'This if statement check if the username textbox OR the password textbox is Null(empty) 
        'IF it is then it shows a message box saying that the textbox is empty then it exits the login with 'Exit Sub'
        If username.Text = vbNullString Or password.Text = vbNullString Then
            MessageBox.Show("You left the username or/and password field blank." & vbNewLine & "Try again..")
            Exit Sub
        End If

        'this disables the two textboxes and the button so the user can't change them or click the button again.
        username.Enabled = False
        password.Enabled = False
        Login.Enabled = False

        'Now if no textboxes are Null then the program POSTs to Gaia with the username and password
        'when the wrapper posts the string strHTML will have the source of the page after the post
        strHTML = Wrapper.PostWrapper("login.gaiaonline.com/gaia/login.php", "username=" & username.Text & "&password=" & password.Text & "&frob=&token=&redirect=http%3A%2F%2Fwww.gaiaonline.com%2F&chap=", "http://gaiaonline.com")

        'This if statement looks at the strHTML string and checks IF strHTML contains the string "Location: http://www.gaiaonline.com/?login_success=1"
        'If it does contain that string that means that the login worked and the user has logged in
        'BUT if it doesn't contain that string then it means that the login failed so the user will have to try again. 
        If strHTML.Contains("Location: http://www.gaiaonline.com/?login_success=1") Then
            MessageBox.Show("Logged in!!")
        Else
            MessageBox.Show("Login Failed")
            'And we re enable the textboxes and buttons so the user can login again
            username.Enabled = True
            password.Enabled = True
            Login.Enabled = True
        End If
t has comments on everything so you can understand everything. This is how it should look now:


Save everything and now we can tryout the login. Go to Debug -> Start Debugging
Your form should appear, now enter a gaia online username and password if everything is setup right you should get this:


If it worked then congratulations! You have created a VB.NET gaia login.

Made by Bllacke.
__________________

.::I retired::.

To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
Reply With Quote
  #2 (permalink)  
Old 12-04-2008, 08:09 PM
TylerK's Avatar
Moderator
 
Join Date: Apr 2007
Location: Do you really want to know?
Posts: 3,191
Thanks: 56
Thanked 46 Times in 34 Posts
My Mood:
Rep Power: 21
Total Rep: 624
Send a message via MSN to TylerK
Default

Ug, I hate VB. But good job I guess
__________________

To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.



To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.

Reply With Quote
  #3 (permalink)  
Old 12-04-2008, 08:11 PM
Bllacke's Avatar
Alumnus
 
Join Date: Nov 2008
Location: Virginia
Posts: 1,425
Thanks: 45
Thanked 74 Times in 50 Posts
My Mood:
Rep Power: 11
Total Rep: 589
Default

VB is too simple?
__________________

.::I retired::.

To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
Reply With Quote
  #4 (permalink)  
Old 01-17-2009, 10:52 PM
Good Member
 
Join Date: Jun 2007
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
Total Rep: 0
Default

Nice tut is there anyway to make it login to a gaia game?
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Always disconnecting at login page after I click on the login button. fsn92 Private Servers 15 11-14-2008 03:52 PM
gaia jigsaw TheGirlForU Gaia Online 2 01-26-2008 11:58 PM
L> for bf on gaia TheGirlForU Gaia Online 0 10-07-2007 09:09 PM
golden gaia? crazyham5ter Gaia Online 5 08-14-2007 09:16 PM
Is there a way to bypass Winsock Packet Editor? Zektor Ghost Online 7 02-27-2007 05:39 PM


All times are GMT -5. The time now is 08:37 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
Copyright 2007 InfoMedia, Inc.
All rights reserved world wide.