Results 1 to 2 of 2

Thread: downloading file using winsock

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,364

    downloading file using winsock

    can someone show me a simple way of doing this?

    winsock.remotehost = "http://www.mysite.com"
    port = 80

    and then a GET for blah.txt

    and it should download this and save it in C:\stuff

    any help guys please?

  2. #2
    Fanatic Member
    Join Date
    Dec 2002
    Location
    North Carolina
    Posts
    734

    Re: downloading file using winsock

    Why do you want to go through all the trouble of making a connection with Winsock? You could simply use this API call:

    VB Code:
    1. Private Declare Function URLDownloadToFile Lib "urlmon" _
    2. Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, _
    3. ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long


    "X-mas is 24.Desember you English morons.." - NoteMe

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