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 ?
Printable View
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 ?
ahh comeone ???
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