Results 1 to 5 of 5

Thread: [Resolved] WinSck and Webpages

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2005
    Posts
    540

    [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.

  2. #2
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    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

  3. #3
    Member
    Join Date
    Nov 2006
    Posts
    43

    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.

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2005
    Posts
    540

    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.

  5. #5
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    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
  •  



Click Here to Expand Forum to Full Width