Go Back   Gaming Gutter > Non-Gaming > Programming > Tutorials


Tutorials - Looking for programming tutorials to increase your knowledge? Do so here.

» Site Navigation
» Home
» FAQ
» Log in
User Name:

Password:

Not a member yet?
Register Now!
» Advertisement
» Recent Threads
Go to first new post Jay's Weekend Quicksales!
Today 12:46 PM
by jtdusk
Last post by jtdusk
Today 12:46 PM
0 Replies, 1 Views
Go to first new post What are image clicks?
Today 12:29 PM
Last post by Footballer
Today 12:45 PM
10 Replies, 11 Views
Go to first new post i am leaving neopets so...
Today 10:56 AM
by hamza
Last post by Check
Today 12:45 PM
10 Replies, 11 Views
Go to first new post Question
08-27-2008 09:17 PM
by NUNRG
Last post by lDeathFirel
Today 12:44 PM
1 Replies, 2 Views
Go to first new post This account has been...
Today 11:49 AM
Last post by Footballer
Today 12:36 PM
11 Replies, 12 Views
Reply
 
LinkBack Thread Tools Display Modes

 [vb6] Basics of HTTPwrapper
Old 03-19-2008, 08:44 PM   #1 (permalink)
second2none second2none is offline Gender Male
Underground
 
second2none is offline
Join Date: Sep 2006
Location: BrisBANE <----
Age: 19
Posts: 5,023
iTrader: 1 / 100%
second2none Is a Party Captainsecond2none Is a Party Captainsecond2none Is a Party Captain
Rep Power: 15
[vb6] Basics of HTTPwrapper

NOTE: I have included my wrapper with this which has some added functions.
NOTE 2: Reading this tutorial is better once you know the basics of vb6. It wi8ll be a lot easier to understand.


[vb6] Basics of HTTPwrapper.

I see alot of people struggle when they come into internet programming in vb6, especially using pre-made wrappers.
HTTPwrapper.zip Contents:
-HTTPwrapper.ctl *
-Stuff.bas *
-Wait.Bas *
-Addon.Bas
(the ones with * are necessary to run HTTPwrapper)

What Is A Wrapper

A wrapper is a user control that uses microsoft winsock. It basically does all the work for you (connecting with winsock, headers, cookies), so in terms its a easier version of winsock.

Adding HTTPwrapper To A Project

When adding HTTPwrapper to Project be sure to add ALL of the files:
HTTPwrapper.ctl
Stuff.bas
Wait.bas
(Adding addon.bas is optional)
Tip: To add files quick in vb6. Press ctrl + D. and the Open Dialog box will appear.

Now your project should look like this.

Now in the side toolbar where you click to add your textboxes etc. You should see this icon.


Move your mouse over it, it should say, HTTPwrapper.

If not, and you have a disabled icon, its because your HTTPwrapper form is open. Just close it and you should be fine.

Once you have the HTTPwrapper added to the project, you need to add it to the form.
Click the ocn I showed you earlier, and add it to the form like you were adding a textbox.
Make it any size preferably small but so you can see the number.
Change the name of the wrapper in the properties box to something, alot of people use "w", I like to just use "wrapper", its easy to remember. Anyway.

Using The "GET" Method

Using the GET method with HTTPwrapper, is the same as if you type a URL in your internet browser. So if in your internet browser you wanted to visit google, the full url would be
"http://www.google.com/"

When using the GET method in HTTPwrapper, its essential you add the "/" at the end. (if you are added keys and values for a PHP file you don't add it to the end if them).

So now we know our URL we will write the code for vb6.
First.
Add 1 Command Button to your form and change the following properties:
Name: cmdGet
Text: Get URL

Double click the button and it should take you to the code screen, and in the button click event, type in.

HTML Code:
Dim strHTML as String
strHTML = wrapper.GetWrapper(URL, REFERRER[optional], PROXY[optional], PORT[optional])


That is the GetWrapper syntax. So now we just fill out our info.


HTML Code:
Dim strHTML as String
strHTML = wrapper.GetWrapper("http://www.google.com/")

Test Run the program and click the button, you will see the numbers go up, then down. That means it worked. So now that we have visited google.com what does strHTML hold?
Visit Google on your browser, once loaded, right click and view source. strHTML now holds all of that information / html / whatever code is there.
So basically we now hold google.com web page content. What can we do with that you might be asking, well.... we can use it to search for unique data to check if we are signed in, program updated, etc. You can also grab information like username., gold, posts etc.
String Search Example:
HTML Code:
Dim strHTML as String
strHTML = wrapper.GetWrapper("http://www.google.com/")
If Instr(1, strHTML, "logo.gif")
msgbox "Logo Is Present"
Else
msgbox "Logo Not Here"
End If
So here we just used the instr function (vb6 built in), so search our strHTML string for logo.gif, and if it was found then, it would msgbox "Logo is present" if not it would msgbox "Logo Not Here". THIS IS Very useful for checking if you are logged in or not.

String Grab Example: (Using Get String Between)
HTML Code:
Dim strHTML as String, strCountry as String
strHTML = wrapper.GetWrapper("http://www.google.com/")
strCountry = Addon.GetStringBetween(strHTML, " pages from ", " </label>")
msgbox strCountry
So using this example, we would grab what was ever between "pages from " and " </label>". In my case (since I live in aus) it would be a mgsbox containing "Australia".

If you need to use httpwrapper to send information to a PHP file, using the php GET function then you just add it like a normal url.
HTML Code:
Dim strHTML as String, strCountry as String
strHTML = wrapper.GetWrapper("http://www.google.com/index.php?message=HI")
Using HTTPwrapper To Send POSTDATA

Sending PostData is very handy when needing to make a login, or fill out a form etc.
So first we need to get the Post Data. Use a firefox addon called Live HTTP Headers.
(TO FIND OUT MORE IN POSTDATA GO HERE DarkZtar)

Once you have the post data its as simple as inputing it.
[html]
Dim strHTML as String
strHTML = wrapper.POSTWrapper(URL, POSTDATA, REFERRER[optional], PROXY[option], PORT[optional])

[/html

So now just insert your Post Data in. (I am using fake data)
HTML Code:
 Dim strHTML as String
 strHTML = wrapper.POSTWrapper("http://google.com/test.php", "fake=postdata&pwnt=ok")
Pretty simple, you can add Intr Checks and Grab Info the same way we did it in the GET method.

Note: Sometimes its required you add the correct referrer.

Things To Know

* If you make a login with the wrapper on form a, and have a new wrapper on form b, and try to call functions from a website that require you to be logged in, it won't work, you need to call them from the wrapper on form a. If that makes sense.

* You cannot connect to HTTPS, this is a HTTP wrapper only.

*Make sure you add ALL files to the project. HTTPwrapper is dependent on them.


DOWNLOAD FILES
RapidShare: 1-Click Webhosting


If you have an questions just ask.
If ther are any errors please tell me


Tutorial Written By Kane
Screenshots Taken By Kane
Wrapper By: Gluarks?

__________________
This is from:
Screenies Of A Mod
Code:
How did you do it? FLP , jotform, some other form of hacking? - First Class Noob
Lawl.. funny shit.

Quote:
Originally Posted by Kore
By k[ore] on Today, 08:44 AM
i'll give you rep alright, but it won't be positive.
Lawl Ownt

Hoes forgot to eat a dick and shut the FUCK UP!
  Reply With Quote

 
Old 03-20-2008, 02:57 PM   #2 (permalink)
Cataclysmic Cataclysmic is offline Gender Male
Spelar lite DotA...
 
Cataclysmic's Avatar
 
Cataclysmic is offline
Join Date: Jan 2008
Location: Amsterdam, NY
Posts: 1,260
iTrader: 3 / 100%
Cataclysmic Is Popular
Rep Power: 3
XD
I take it I drove you to write this?

Well, either way, very nice.
This'll help me remember some things.
+Rep (if I can yet.)

Also, for the sense of irony:

Quote:
Dim strHTML as String
strHTML = wrapper.GetWrapper("http://www.google.com/")
If Instr(1, strHTML, "logo.gif") Then
msgbox "Logo Is Present"
Else
msgbox "Logo Not Here"
End If
Forgot your 'Then' statement...
:]

EDIT: Damn it. Can't +Rep you yet...Ugh...
__________________
We should seriously just automatically deny anyone with something along the lines of "Current Goal: UG" in their signature.

Quote:
Kyo: Cataclysmic, I love you now
-------------------------------------
second2none: unfortunately if you have a gf, you are already paying for sex.
-------------------------------------
ANON - Dark has left the conversation.
Nomhak says: what a faggot
-------------------------------------

Sejiru: You look like a person who'd win an award of greatness in the field of excellency!
  Reply With Quote

 
Old 03-20-2008, 03:24 PM   #3 (permalink)
second2none second2none is offline Gender Male
Underground
 
second2none is offline
Join Date: Sep 2006
Location: BrisBANE <----
Age: 19
Posts: 5,023
iTrader: 1 / 100%
second2none Is a Party Captainsecond2none Is a Party Captainsecond2none Is a Party Captain
Rep Power: 15
Quote:
Originally Posted by Cataclysmic View Post
XD
I take it I drove you to write this?

Well, either way, very nice.
This'll help me remember some things.
+Rep (if I can yet.)

Also, for the sense of irony:



Forgot your 'Then' statement...
:]

EDIT: Damn it. Can't +Rep you yet...Ugh...
\Kinda xD nad I know alot of people cant find a HTTPwrapper guide.. And yeah I wrote this at like 1am XD lawl... thanks.
__________________
This is from:
Screenies Of A Mod
Code:
How did you do it? FLP , jotform, some other form of hacking? - First Class Noob
Lawl.. funny shit.

Quote:
Originally Posted by Kore
By k[ore] on Today, 08:44 AM
i'll give you rep alright, but it won't be positive.
Lawl Ownt

Hoes forgot to eat a dick and shut the FUCK UP!
  Reply With Quote

 
Old 03-20-2008, 03:25 PM   #4 (permalink)
|G3| |G3| is online now Gender Female

 
|G3|'s Avatar
 
|G3| is online now
Join Date: Feb 2007
Posts: 3,083
iTrader: 6 / 100%
|G3| Total Celebrity|G3| Total Celebrity|G3| Total Celebrity|G3| Total Celebrity|G3| Total Celebrity|G3| Total Celebrity
Rep Power: 17
Quote:
Originally Posted by second2none View Post
\Kinda xD nad I know alot of people cant find a HTTPwrapper guide.. And yeah I wrote this at like 1am XD lawl... thanks.
Yeah people IM me about this all the time..
Nice guide.
__________________
PROGRAMMING CONTEST

Surf-g3.com | Glype.co.uk| Proxyg3.com
GAIA FLP GENERATOR: http://gen.gaiaflps.com/index.php


Thanks Hatz ;3

Quote:
Originally Posted by Li-Shun
Well, we aren't talking about it, but we're thinking about how you're the coolest mech and it's impossible to get a frickin action figure of you.
Sold out everywhere! D<
  Reply With Quote

 
Old 03-20-2008, 03:27 PM   #5 (permalink)
Cataclysmic Cataclysmic is offline Gender Male
Spelar lite DotA...
 
Cataclysmic's Avatar
 
Cataclysmic is offline
Join Date: Jan 2008
Location: Amsterdam, NY
Posts: 1,260
iTrader: 3 / 100%
Cataclysmic Is Popular
Rep Power: 3
Quote:
Originally Posted by second2none View Post
\Kinda xD nad I know alot of people cant find a HTTPwrapper guide.. And yeah I wrote this at like 1am XD lawl... thanks.
You always seem to do shit late. xP

Well, it's a good beginner's guide.
Granted I can only use it for future reference. But, I wish I had this before.
Especially because you linked to a download for it. XP
Took me forever to find it.
__________________
We should seriously just automatically deny anyone with something along the lines of "Current Goal: UG" in their signature.

Quote:
Kyo: Cataclysmic, I love you now
-------------------------------------
second2none: unfortunately if you have a gf, you are already paying for sex.
-------------------------------------
ANON - Dark has left the conversation.
Nomhak says: what a faggot
-------------------------------------

Sejiru: You look like a person who'd win an award of greatness in the field of excellency!
  Reply With Quote

 
Old 03-20-2008, 04:50 PM   #6 (permalink)
second2none second2none is offline Gender Male
Underground
 
second2none is offline
Join Date: Sep 2006
Location: BrisBANE <----
Age: 19
Posts: 5,023
iTrader: 1 / 100%
second2none Is a Party Captainsecond2none Is a Party Captainsecond2none Is a Party Captain
Rep Power: 15
lawl thanks g3..

and yeah its cause I was on night shift this week xD start at 2.30pm finish at 11pm. So I didnt sleep till like 3-4am.

xD
__________________
This is from:
Screenies Of A Mod
Code:
How did you do it? FLP , jotform, some other form of hacking? - First Class Noob
Lawl.. funny shit.

Quote:
Originally Posted by Kore
By k[ore] on Today, 08:44 AM
i'll give you rep alright, but it won't be positive.
Lawl Ownt

Hoes forgot to eat a dick and shut the FUCK UP!
  Reply With Quote

 
Old 03-20-2008, 04:54 PM   #7 (permalink)
Cataclysmic Cataclysmic is offline Gender Male
Spelar lite DotA...
 
Cataclysmic's Avatar
 
Cataclysmic is offline
Join Date: Jan 2008
Location: Amsterdam, NY
Posts: 1,260
iTrader: 3 / 100%
Cataclysmic Is Popular
Rep Power: 3
That's understandable.
So, give me a brief...one sentence description what Addon.bas's purpose is?
__________________
We should seriously just automatically deny anyone with something along the lines of "Current Goal: UG" in their signature.

Quote:
Kyo: Cataclysmic, I love you now
-------------------------------------
second2none: unfortunately if you have a gf, you are already paying for sex.
-------------------------------------
ANON - Dark has left the conversation.
Nomhak says: what a faggot
-------------------------------------

Sejiru: You look like a person who'd win an award of greatness in the field of excellency!
  Reply With Quote

 
Old 03-21-2008, 01:20 AM   #8 (permalink)
second2none second2none is offline Gender Male
Underground
 
second2none is offline
Join Date: Sep 2006
Location: BrisBANE <----
Age: 19
Posts: 5,023
iTrader: 1 / 100%
second2none Is a Party Captainsecond2none Is a Party Captainsecond2none Is a Party Captain
Rep Power: 15
Holds functions for me o_0

Instead of adding them all separately ,m I just add them from a module.
__________________
This is from:
Screenies Of A Mod
Code:
How did you do it? FLP , jotform, some other form of hacking? - First Class Noob
Lawl.. funny shit.

Quote:
Originally Posted by Kore
By k[ore] on Today, 08:44 AM
i'll give you rep alright, but it won't be positive.
Lawl Ownt

Hoes forgot to eat a dick and shut the FUCK UP!
  Reply With Quote

 
Old 03-21-2008, 06:38 AM   #9 (permalink)
Googlrr Googlrr is online now Gender Male
 
Googlrr's Avatar
 
Googlrr is online now
Join Date: Oct 2006
Location: New Hampshire?
Posts: 6,541
iTrader: 0 / 0%
Googlrr Is a Party CaptainGooglrr Is a Party CaptainGooglrr Is a Party Captain
Rep Power: 16
I've been trying to give you +rep for a few weeks now, but it keeps telling me I need to spread it around >.>

Nice guide ^^
__________________

Li-Shun is a god. ^


hatzganatta is awesome too ^^
  Reply With Quote

 
Old 03-23-2008, 10:23 PM   #10 (permalink)
rcadble rcadble is offline Gender Male
Underground
 
rcadble is offline
Join Date: Sep 2006
Posts: 217
iTrader: 0 / 0%
rcadble Is Recognizable
Rep Power: 6
The wrapper is by Glurak.

Good tutorial, nonetheless. It should help beginners. +rep
__________________
Omnipresent Autobuyer, the best free autobuyer.
Version 1.2
Always around, always present.
  Reply With Quote
Reply

Bookmarks



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

Powered by vBadvanced CMPS v3.0 RC2

All times are GMT -7. The time now is 12:46 PM.


vBulletin skin developed by: eXtremepixels
The contents of this webpage are copyright © 2006-2008 GamingGutter.com. All Rights Reserved.

Page generated in 0.31139588 seconds (100.00% PHP - 0% MySQL) with 19 queries