Results 1 to 3 of 3

Thread: WinSoc quick help

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2002
    Location
    USA
    Posts
    432

    WinSoc quick help

    I want to let my program connect to my site wich is
    www.programminghelper.com and download a CPU.txt file and place it in the app path how can i do this ?

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2002
    Location
    USA
    Posts
    432
    ahh comeone ???

  3. #3
    Junior Member
    Join Date
    Mar 2002
    Location
    Adelaide, Australia
    Posts
    27

    pretty dam easy

    it can be done using "Microsoft Internet Transfer Control". then the code is simply. call the control "inet1"

    dim srtresult as string

    Private Sub downloadtxtfile()
    strResult = Inet1.OpenURL("http://www.yoursite.com/readme.txt", icString)

    'Essential to avoid tying up the system
    Do Until Inet1.StillExecuting = False ' WAIT Downloading..
    DoEvents
    Loop

    lblreadme.caption = strresult
    end sub

    DONE!

    To download a picture and save it

    private sub downloadpicture()
    'Download the picture
    byteResult() = Inet1.OpenURL("http://www.yoursite.com/picture.jpg", icByteArray)

    'Open a binary file and load data into it!
    fn = FreeFile
    Open App.Path & "\temp.jpg" For Binary Access Write As #fn
    Put #fn, , byteResult()
    'Close the open file
    Close #fn

    end sub


    ChAdWiCk

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