|
-
Nov 21st, 2006, 10:21 AM
#1
Thread Starter
Fanatic Member
[Resolved] WinSck and Webpages
I was wondering... if it was possible to load text off webpages using the WinSock control?
The reason i want to do this is so that i can download files from an internet site without my program freezing (which is what happens when you use Inet).
I just don't understand how the WinSock will connect to the webpage and then the web page will transfer its contents.
I want RAW data from the webpage, not like what you see, it should download the headers, HTML the lot - This is for when i download files using the same princible.
I'm making an updater program for another program that i'm making, so i'm kind of looking for a progress bar too, but can do with out.
So can any one help me solve this problem? Thanks!
Last edited by Slyke; Nov 21st, 2006 at 10:34 AM.
-
Nov 21st, 2006, 10:27 AM
#2
Re: WinSck and Webpages
When you have a problem, you should search on the forums first, or do you like other people to search for you ?
When searching, this is what I found, I think it's what you need:
http://www.vbforums.com/showthread.p...hlight=winsock
-
Nov 21st, 2006, 10:29 AM
#3
Member
Re: WinSck and Webpages
You can connect to a webserver with the Winsock (ws) control and then send a http request to the server.
ws.Remotehost =<address>
ws.Remoteport=80
ws.connect
while ws.state <> sckConnected
doevents
wend
ws.senddata "get /" & nameofpage & " HTTP/1.0" & vbcrlf & vbcrlf
And then fetch the page in the Dataarrival event for the winsock control.
I'm not sure if i got all the syntax right, i wrote the code in my web brower.
-
Nov 21st, 2006, 10:31 AM
#4
Thread Starter
Fanatic Member
Re: WinSck and Webpages
I swear that never came up when i searched for it, just heaps and heaps of posts about winsock or web page related stuff...
Yes that's what i wanted as far as i can tell, i'll need a bit to go over the code. I only wanted it to load the webpage. Don't need PHP or anything.
Edit***, yes that's it, thanks and sorry for not finding it myself.
-
Nov 21st, 2006, 11:04 AM
#5
Re: [Resolved] WinSck and Webpages
Whenever I need something, first I search in the CodeBank, then if I don't find it, I serch in the other forums, like Classic Visual Basic...
In the CodeBank, the link I posted was the forth from the top...
Thanks for the cookie by the way
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|