|
-
Jan 22nd, 2003, 02:27 AM
#1
Thread Starter
Fanatic Member
Saving Internet Files
hi all,
i have got a hyperlink:
for eg: www.mywebsite.com/data/showdata.asp?code=999
i want to open this page programatically and save it to my local harddisk.
pls guide me, how to do that.
regards and thanx in advance.
prakash
-
Jan 22nd, 2003, 06:18 AM
#2
Fanatic Member
I would just use a little VB App as below...
VB Code:
Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
Public Function DownloadFile(URL As String, LocalFilename As String) As Boolean
Dim lngRetVal As Long
lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0)
If lngRetVal = 0 Then DownloadFile = True
End Function
Private Sub Form_Load()
DownloadFile "www.mywebsite.com/data/showdata.asp?code=999", "c:\YourFile.htm"
End Sub
-
Jan 22nd, 2003, 09:07 AM
#3
Thread Starter
Fanatic Member
thanx smith,
but what if the file is not available on the server??
regards
prakash
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
|