Results 1 to 2 of 2

Thread: winsock anyone?

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2000
    Posts
    7
    Anyone can tell me how to download a page using Winsock?
    Also, how do I install Winsock? Where can I get it?

    Thanks.

  2. #2
    Addicted Member
    Join Date
    Apr 2000
    Posts
    215
    It depends what type vb u have if you have, if its a professional edition or enterprise edition then it comes with winsock control. Press ctrl+t when in vb then scroll down to Microsoft Winsock Control and check that box, and then add one to your form.

    if you have a learning addition then go to
    http://www.planet-source-code.com and search the vb section for winsock patch and you should find a download which will install and apply a registry patch so you can use it.

    as for getting it to download a page its more difficult than inet controls, you have to connect to the webpage on port 80 and the send data to tell it to give you the page,

    so in a command buttons click event you would have

    winsock1.connect "http://www.whatever.com", 80

    then in the winsock connection event, you'd send the data

    Winsock1.SendData "GET " & "index.html" & " HTTP/1.0" & vbCrLf & vbCrLf

    and then in the winsock data arrival event you'd have something like

    dim whatever as string
    winsock1.getdata whatever
    text1.text = whatever

    Now I am not sure if that will work for you as I am on a proxy server, and have to send the data to my proxy server to grab me the pages source. But it should work (I think) if I'm wrong can someone post here the correct way when not on a proxy server.

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