|
-
Apr 8th, 2002, 09:05 PM
#1
Thread Starter
Hyperactive Member
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 ?
-
Apr 9th, 2002, 12:17 AM
#2
Thread Starter
Hyperactive Member
-
Apr 9th, 2002, 12:59 AM
#3
Junior Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|