Jump to content
xisto Community
Sign in to follow this  
de4thpr00f

[vb.net] Gaiaonline Login Login through vb.net

Recommended Posts

This tutorial will teach you how to login in gaiaonline through vb.net.

I'll do it with a way that you don't need to leave vb.net to get/post (bad joke) anything.

 

What you need in this tutorial is:

Download and extract the Resources.rar file (i'll use 'c:\resources' in this project)

This tutorial :D

Now let's start

Open the VS.NET and create a new project:

Posted Image

You now have something, that is called a form, let's rename it to GaiaLogin

Posted Image

Easy, let's take a look at the form

Posted Image

What?? Form1? But i renamed it...

Ok, if you really said that just close this window right now.

That's the title of the form, let's rename it

Click on the form (anywhere)

On the properties locate 'Text' and change 'form1' to 'GaiaOnline'

Posted Image

 

Ok, now we are talking.

Let's insert 1 textbox on the form (see example for details)

Posted Image

Yes, simple as drag and drop, but i want this textbox to be multiline and to have a vertival scroll. (easier to see what you'll get from teh website)

So, the way that i'm going to do this is to select the textbox and go to properties (like we did to change the form1 title to GaiaOnline) and select "multiline -> true" and "Scroolbars -> Both" (yes, i changed my mind)

Now just resize the textbox, mine is like this:

Posted Image

ok, all set.

Did you extract the Resources.rar?

Let's use it.

Save your project

Copy the c:\recources\SleepModule.vb and c:\recources\Stuff.vb and c:\recources\wrapper.* to your project path (mine is C:\vb.net\GaiaLogin\GaiaLogin\)

All set?

Let's move then.

Go back to your project.

Let's add the references

Posted Image

Posted Image

Ok, it was easy.

Now we need to insert them on the project.

You should have a tab that says "Object Browser", if you don't have it press "F2"

Posted Image

Ok, as shown in the picture, you select the Object to insert and click on the small button that is focused in the image.

Do this to AxInterop.* and Interop.*

 

Now let's add the modules to the project, select the gaionline project and follow the pictures.

Posted Image

Posted Image

Press add and let's move to the code (press 2 times on the form):

you should see this

Posted Image

Now, let's make some changes to the code:

After

Public Class GaiaLogin
Add

Dim wrap As New HTTPWrapper
like this

Posted Image

 

Ok, we are ready to go.

Let's see what gaia online has for us

after this

Private Sub GaiaLogin_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
add

TextBox1.Text = wrap.GetWrapper("http://gaiaonline.com")
and press F5

What did you got?

Your first error :D

The reason for that is that you shouldn't trust me as much as you think, you'll get some errors during this tutorials (come on, it's part of the job)

Note, you need to stop the script before continue (to do this you have a play and a stop button in a bar, yes press the stop one)

To solve this problem let's replace the above code with

TextBox1.Text = wrap.GetWrapper("http://gaiaonline.com/")
That's it, the slash :)

So, now press F5

Posted Image

Wow, what is that?

Yes, it's a little bit confusing, but it's easier to get what we want.

Let's take a look to the code in that textbox.

 

Done?

 

What i found interesting was this:

<form method="post" id="loginForm" action="http://login.gaiaonline.com/gaia/login.php">					<fieldset>				<label for="username">Username:</label><input type="text" id="username" name="username" tabindex="1" />			</fieldset>						<fieldset>				<label for="password">Password:</label><input type="password" id="password" name="password" tabindex="2" />						</fieldset>
let's give it a try

Close the window.

In the code replace

TextBox1.Text = wrap.GetWrapper("http://gaiaonline.com/")
with

TextBox1.Text = wrap.PostWrapper("http://login.gaiaonline.com/gaia/login.php", "username=Zer0&password=mypassword") 'please replace with your data
and run the script again (F5)

hmm, interesting.

It's shorter

HTTP/1.0 302 FoundDate: Tue, 11 Dec 2007 12:05:44 GMTServer: ApacheX-Powered-By: PHP/5.1.5Set-Cookie: gaia4_ano=13858786241197374744; path=/; domain=.gaiaonline.comSet-Cookie: gaia4_ano=13858786241197374744; path=/; domain=.gaiaonline.comSet-Cookie: gaia4_sid=0057f0c85e611139e4a9cf77d01986f9; path=/; domain=.gaiaonline.comSet-Cookie: gaia4_data=deleted; expires=Mon, 11-Dec-2006 12:05:43 GMT; path=/; domain=login.gaiaonline.comSet-Cookie: gaia4_ano=13858786241197374744; path=/; domain=.gaiaonline.comSet-Cookie: gaia4_sid=f5b0b6d0194b761d7d156ad280cfe74600002f258bec3d11; path=/; domain=.gaiaonline.comSet-Cookie: gaia4_data=a%3A1%3A%7Bs%3A11%3A%22autologinid%22%3Bs%3A0%3A%22%22%3B%7D; path=/; domain=login.gaiaonline.comLocation: gaiaonline.com/?login_success=1Content-Length: 0Vary: Accept-Encoding,User-AgentConnection: closeContent-Type: text/html
let's see what info the next page will show.

after

TextBox1.Text = wrap.PostWrapper("http://login.gaiaonline.com/gaia/login.php", "username=Zer0&password=mypassword") 'please replace with your data
add

TextBox1.Text = wrap.GetWrapper("gaiaonline.com/?login_success=1;
and press F5 again

Hmm, bigger again. But look what i found in the code

src="http://s.gaiaonline.com/images/gaia_global/gaia_header/ic_shortcuts.gif" alt="Shortcuts"/>Shortcuts</div></li>			<li id="messages"><a href="/profile/privmsg.php" class="newMail">(2)</a></li>		</ul>
I have new mail, interesting, let's see if i can read it through vb (note that i am logged already)

so the link to my private messages is?

I'll let you answer this one.

Let's keep going with the code.

I want to read my messages now.

after

TextBox1.Text = wrap.GetWrapper("gaiaonline.com/?login_success=1;
I'll add

TextBox1.Text = wrap.GetWrapper("gaiaonline.com/auth/?redirect=%2Fprofile%2Fprivmsg.php;
and press F5 again

And yes, after a while i found this

<img src="http://s.gaiaonline.com/images/template/folder_new.gif" width="19" height="18" alt="New Message" title="New Message" /></td>							<td valign="top"><span class="topictitle"><a href="/profile/privmsg.php?folder=inbox&mode=read&id=4537.1478364922" class="topictitle"><strong>You've received a special gift!</strong><br /><span class="gensmall" style="font-weight:normal;"></span></a></span></td>							<td valign="top"><span class="name"> <a href="/profile/?view=profile.ShowProfile&item=4537" class="name"  style="font-weight:bold;color:#D75252"><strong>[NPC] Rina</strong></a></span></td>			  <td NOWRAP><span class="postdetails"><strong>Thu Dec 06, 2007 5:36 am</strong></span></td>			  <td align="center"><input type="checkbox" name="mark[]" value="4537.1478364922" /></td>			</tr>						<tr>			  <td colspan="5"><img src="http://s.gaiaonline.com/images/template/s.gif" width="1" height="2"></td>			</tr>			<tr bgcolor=#FFFFFF>							<td valign="top"><img src="http://s.gaiaonline.com/images/template/folder_new.gif" width="19" height="18" alt="New Message" title="New Message" /></td>							<td valign="top"><span class="topictitle"><a href="/profile/privmsg.php?folder=inbox&mode=read&id=10566556.1476371945" class="topictitle"><strong>(no subject)</strong><br /><span class="gensmall" style="font-weight:normal;"></span></a></span></td>							<td valign="top"><span class="name"> <a href="/profile/?view=profile.ShowProfile&item=10566556" class="name"  style="font-weight:bold;color: ##2244A2"><strong>ICAN'T SHOW YOU THIS NAME</strong></a></span></td>
Wow, ok, i'm not going to show you that message now that we are logged.

I just want to finish this.

Let's move to the design again.

But first, take a look at the code that is parsed to the html, you should notice that you have one thing different that show us that we are logged.

Did you find it?

Good, let's move then :P

Remove that stupid textbox1.

Create something similar to this

Posted Image

Ok, what you should know by now is how to set a name to a textbox or to a button (in the properties), so let's use our capabilities, i named the button as Loggin, the first textbox as username and the second as password.

Let's move to the code (press 2 times on the form)

Hmm, i forgot, you want to login using the button (:D see the errors are coming to us :))

Ok, let's go back to the form, now, instead of clicking 2 times on the form, let's do the same on the button.

Good, you should see a new thing on the code

Private Sub Login_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Login.Click	End Sub

haha, let's move it.

Add this to the login button

Dim strHtml As String		strHtml = wrap.PostWrapper("http://login.gaiaonline.com/gaia/login.php", "username=" & username.Text & "&password=" & password.Text)		strHtml = wrap.GetWrapper("gaiaonline.com/?login_success=1;
that's it, press F5, insert your data and try now.

Easy hein? What?

Nothing showed up?

Damn, i forgot again, the thing we need to know that we are logged is "Gold:"

Let's see.

add this code to the button

If InStr(strHtml, "Gold") Then			MsgBox("You are logged!")		Else			MsgBox("Loggin failed!")		End If
Press F5 and insert your data

Posted Image

Hehe, cool... OK goo lu... What?

You want to know the amount of gold in the account?

But that's a new function... OK ok, calm down.

It's also easy

Let's change the if thing.

After the "If instr(strhtml, "Gold") Then"

Let's add

Dim gold As String = wrap.iB(strHtml, "Gold: </span>", "<")			MsgBox("You have " & gold)
The iB, is the function in between, if you had look to the code you would see that the amount of gold is between Gold: </span> and <, and that's what we want. Run the program.

Posted Image

HEHE, we did it.

Now it's done, (donate i'm poor :P)

Now good luck at your code.

Resources.zip

Share this post


Link to post
Share on other sites

Hello

 

Thanks for the nice tutorial...but can you help me get it working for utherverse.com? that is https://www.utherverse.com/login.aspx will try to do it myself now...if anyone can help me that would be great..

 

 

Thanks

 

This tutorial will teach you how to login in gaiaonline through vb.net.

I'll do it with a way that you don't need to leave vb.net to get/post (bad joke) anything.

 

What you need in this tutorial is:

Download and extract the Resources.rar file (i'll use 'c:\resources' in this project)

This tutorial :)

Now let's start

Open the VS.NET and create a new project:

Posted Image

You now have something, that is called a form, let's rename it to GaiaLogin

Posted Image

Easy, let's take a look at the form

Posted Image

What?? Form1? But i renamed it...

Ok, if you really said that just close this window right now.

That's the title of the form, let's rename it

Click on the form (anywhere)

On the properties locate 'Text' and change 'form1' to 'GaiaOnline'

Posted Image

 

Ok, now we are talking.

Let's insert 1 textbox on the form (see example for details)

Posted Image

Yes, simple as drag and drop, but i want this textbox to be multiline and to have a vertival scroll. (easier to see what you'll get from teh website)

So, the way that i'm going to do this is to select the textbox and go to properties (like we did to change the form1 title to GaiaOnline) and select "multiline -> true" and "Scroolbars -> Both" (yes, i changed my mind)

Now just resize the textbox, mine is like this:

Posted Image

ok, all set.

Did you extract the Resources.rar?

Let's use it.

Save your project

Copy the c:\recources\SleepModule.vb and c:\recources\Stuff.vb and c:\recources\wrapper.* to your project path (mine is C:\vb.net\GaiaLogin\GaiaLogin\)

All set?

Let's move then.

Go back to your project.

Let's add the references

Posted Image

Posted Image

Ok, it was easy.

Now we need to insert them on the project.

You should have a tab that says "Object Browser", if you don't have it press "F2"

Posted Image

Ok, as shown in the picture, you select the Object to insert and click on the small button that is focused in the image.

Do this to AxInterop.* and Interop.*

 

Now let's add the modules to the project, select the gaionline project and follow the pictures.

Posted Image

Posted Image

Press add and let's move to the code (press 2 times on the form):

you should see this

Posted Image

Now, let's make some changes to the code:

After

Public Class GaiaLogin
Add

Dim wrap As New HTTPWrapper
like this

Posted Image

 

Ok, we are ready to go.

Let's see what gaia online has for us

after this

Private Sub GaiaLogin_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
add

TextBox1.Text = wrap.GetWrapper("http://gaiaonline.com")
and press F5

What did you got?

Your first error B)

The reason for that is that you shouldn't trust me as much as you think, you'll get some errors during this tutorials (come on, it's part of the job)

Note, you need to stop the script before continue (to do this you have a play and a stop button in a bar, yes press the stop one)

To solve this problem let's replace the above code with

TextBox1.Text = wrap.GetWrapper("http://gaiaonline.com/")
That's it, the slash :D

So, now press F5

Posted Image

Wow, what is that?

Yes, it's a little bit confusing, but it's easier to get what we want.

Let's take a look to the code in that textbox.

 

Done?

 

What i found interesting was this:

<form method="post" id="loginForm" action="http://login.gaiaonline.com/gaia/login.php">					<fieldset>				<label for="username">Username:</label><input type="text" id="username" name="username" tabindex="1" />			</fieldset>						<fieldset>				<label for="password">Password:</label><input type="password" id="password" name="password" tabindex="2" />						</fieldset>
let's give it a try

Close the window.

In the code replace

TextBox1.Text = wrap.GetWrapper("http://gaiaonline.com/")
with

TextBox1.Text = wrap.PostWrapper("http://login.gaiaonline.com/gaia/login.php", "username=Zer0&password=mypassword") 'please replace with your data
and run the script again (F5)

hmm, interesting.

It's shorter

HTTP/1.0 302 FoundDate: Tue, 11 Dec 2007 12:05:44 GMTServer: ApacheX-Powered-By: PHP/5.1.5Set-Cookie: gaia4_ano=13858786241197374744; path=/; domain=.gaiaonline.comSet-Cookie: gaia4_ano=13858786241197374744; path=/; domain=.gaiaonline.comSet-Cookie: gaia4_sid=0057f0c85e611139e4a9cf77d01986f9; path=/; domain=.gaiaonline.comSet-Cookie: gaia4_data=deleted; expires=Mon, 11-Dec-2006 12:05:43 GMT; path=/; domain=login.gaiaonline.comSet-Cookie: gaia4_ano=13858786241197374744; path=/; domain=.gaiaonline.comSet-Cookie: gaia4_sid=f5b0b6d0194b761d7d156ad280cfe74600002f258bec3d11; path=/; domain=.gaiaonline.comSet-Cookie: gaia4_data=a%3A1%3A%7Bs%3A11%3A%22autologinid%22%3Bs%3A0%3A%22%22%3B%7D; path=/; domain=login.gaiaonline.comLocation: gaiaonline.com/?login_success=1Content-Length: 0Vary: Accept-Encoding,User-AgentConnection: closeContent-Type: text/html
let's see what info the next page will show.

after

TextBox1.Text = wrap.PostWrapper("http://login.gaiaonline.com/gaia/login.php", "username=Zer0&password=mypassword") 'please replace with your data
add

TextBox1.Text = wrap.GetWrapper("gaiaonline.com/?login_success=1;
and press F5 again

Hmm, bigger again. But look what i found in the code

src="http://s.gaiaonline.com/images/gaia_global/gaia_header/ic_shortcuts.gif" alt="Shortcuts"/>Shortcuts</div></li>			<li id="messages"><a href="/profile/privmsg.php" class="newMail">(2)</a></li>		</ul>
I have new mail, interesting, let's see if i can read it through vb (note that i am logged already)

so the link to my private messages is?

I'll let you answer this one.

Let's keep going with the code.

I want to read my messages now.

after

TextBox1.Text = wrap.GetWrapper("gaiaonline.com/?login_success=1;
I'll add

TextBox1.Text = wrap.GetWrapper("gaiaonline.com/auth/?redirect=%2Fprofile%2Fprivmsg.php;
and press F5 again

And yes, after a while i found this

<img src="http://s.gaiaonline.com/images/template/folder_new.gif" width="19" height="18" alt="New Message" title="New Message" /></td>							<td valign="top"><span class="topictitle"><a href="/profile/privmsg.php?folder=inbox&mode=read&id=4537.1478364922" class="topictitle"><strong>You've received a special gift!</strong><br /><span class="gensmall" style="font-weight:normal;"></span></a></span></td>							<td valign="top"><span class="name"> <a href="/profile/?view=profile.ShowProfile&item=4537" class="name"  style="font-weight:bold;color:#D75252"><strong>[NPC] Rina</strong></a></span></td>			  <td NOWRAP><span class="postdetails"><strong>Thu Dec 06, 2007 5:36 am</strong></span></td>			  <td align="center"><input type="checkbox" name="mark[]" value="4537.1478364922" /></td>			</tr>						<tr>			  <td colspan="5"><img src="http://s.gaiaonline.com/images/template/s.gif" width="1" height="2"></td>			</tr>			<tr bgcolor=#FFFFFF>							<td valign="top"><img src="http://s.gaiaonline.com/images/template/folder_new.gif" width="19" height="18" alt="New Message" title="New Message" /></td>							<td valign="top"><span class="topictitle"><a href="/profile/privmsg.php?folder=inbox&mode=read&id=10566556.1476371945" class="topictitle"><strong>(no subject)</strong><br /><span class="gensmall" style="font-weight:normal;"></span></a></span></td>							<td valign="top"><span class="name"> <a href="/profile/?view=profile.ShowProfile&item=10566556" class="name"  style="font-weight:bold;color: ##2244A2"><strong>ICAN'T SHOW YOU THIS NAME</strong></a></span></td>
Wow, ok, i'm not going to show you that message now that we are logged.

I just want to finish this.

Let's move to the design again.

But first, take a look at the code that is parsed to the html, you should notice that you have one thing different that show us that we are logged.

Did you find it?

Good, let's move then :(

Remove that stupid textbox1.

Create something similar to this

Posted Image

Ok, what you should know by now is how to set a name to a textbox or to a button (in the properties), so let's use our capabilities, i named the button as Loggin, the first textbox as username and the second as password.

Let's move to the code (press 2 times on the form)

Hmm, i forgot, you want to login using the button (:D see the errors are coming to us :()

Ok, let's go back to the form, now, instead of clicking 2 times on the form, let's do the same on the button.

Good, you should see a new thing on the code

Private Sub Login_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Login.Click	End Sub

haha, let's move it.

Add this to the login button

Dim strHtml As String		strHtml = wrap.PostWrapper("http://login.gaiaonline.com/gaia/login.php", "username=" & username.Text & "&password=" & password.Text)		strHtml = wrap.GetWrapper("gaiaonline.com/?login_success=1;
that's it, press F5, insert your data and try now.

Easy hein? What?

Nothing showed up?

Damn, i forgot again, the thing we need to know that we are logged is "Gold:"

Let's see.

add this code to the button

If InStr(strHtml, "Gold") Then			MsgBox("You are logged!")		Else			MsgBox("Loggin failed!")		End If
Press F5 and insert your data

Posted Image

Hehe, cool... OK goo lu... What?

You want to know the amount of gold in the account?

But that's a new function... OK ok, calm down.

It's also easy

Let's change the if thing.

After the "If instr(strhtml, "Gold") Then"

Let's add

Dim gold As String = wrap.iB(strHtml, "Gold: </span>", "<")			MsgBox("You have " & gold)
The iB, is the function in between, if you had look to the code you would see that the amount of gold is between Gold: </span> and <, and that's what we want. Run the program.

Posted Image

HEHE, we did it.

Now it's done, (donate i'm poor :))

Now good luck at your code.


Edited by sourabhj (see edit history)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.