|
-
Jan 22nd, 2003, 06:37 PM
#1
Thread Starter
Addicted Member
urgent help about downloading a file from the internet
how do i find out when the file is finished downloading?, this is what i got:
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 Command1_Click()
DownloadFile "http://members.lycos.co.uk/z0n3_x/login.html", "c:\KSNET.htm"
End Sub
-
Jan 23rd, 2003, 04:46 PM
#2
Thread Starter
Addicted Member
thatsforvisualc/c++
-
Jan 23rd, 2003, 05:05 PM
#3
Frenzied Member
VB Code:
Option Explicit
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()
MsgBox "Going to download a file."
DownloadFile "http://members.lycos.co.uk/z0n3_x/login.html", "c:\KSNET.htm"
MsgBox Dir("C:\ksnet.htm")
End Sub
Function doesn't return until the operation is complete.
-
Jan 23rd, 2003, 05:21 PM
#4
Thread Starter
Addicted Member
whatdoyoumean?iwantthatwhenthefileisfinisheddownloadingitpopsamsgsayingdownloadcompleted
-
Jan 23rd, 2003, 05:35 PM
#5
Frenzied Member
Originally posted by Shawn N
VB Code:
Option Explicit
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()
MsgBox "Going to download a file."
DownloadFile "http://members.lycos.co.uk/z0n3_x/login.html", "c:\KSNET.htm"
MsgBox "download completed"
End Sub
Function doesn't return until the operation is complete.
Last time I try to read that rainbow writing.
-
Jan 23rd, 2003, 05:45 PM
#6
Thread Starter
Addicted Member
oh sorry lol, didnt see that u changed the code hehe, thanks
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
|