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
Private Const ERROR_SUCCESS As Long = 0
Private Const BINDF_GETNEWESTVERSION As Long = &H10
Private Const INTERNET_FLAG_RELOAD As Long = &H80000000Public Function DownloadFile(sSourceUrl As String, _
sLocalFile As String) As Boolean
DownloadFile = URLDownloadToFile(0&, _
sSourceUrl, _
sLocalFile, _
BINDF_GETNEWESTVERSION, _
0&) = ERROR_SUCCESS
End FunctionPrivate Sub Command1_Click()
Dim sSourceUrl As String
Dim sLocalFile As String
sSourceUrl = "ftp://118.156.8.122/bjl.ini"
sLocalFile = "d:\bjl.ini"
DeleteUrlCacheEntry (sSourceUrl) If DownloadFile(sSourceUrl, sLocalFile) Then MsgBox "下载成功"
End IfEnd Sub已经清楚缓存了,还是不行,请问为什么呢?
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
Private Const ERROR_SUCCESS As Long = 0
Private Const BINDF_GETNEWESTVERSION As Long = &H10
Private Const INTERNET_FLAG_RELOAD As Long = &H80000000Public Function DownloadFile(sSourceUrl As String, _
sLocalFile As String) As Boolean
DownloadFile = URLDownloadToFile(0&, _
sSourceUrl, _
sLocalFile, _
BINDF_GETNEWESTVERSION, _
0&) = ERROR_SUCCESS
End FunctionPrivate Sub Command1_Click()
Dim sSourceUrl As String
Dim sLocalFile As String
sSourceUrl = "ftp://118.156.8.122/bjl.ini"
sLocalFile = "d:\bjl.ini"
DeleteUrlCacheEntry (sSourceUrl) If DownloadFile(sSourceUrl, sLocalFile) Then MsgBox "下载成功"
End IfEnd Sub已经清楚缓存了,还是不行,请问为什么呢?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货