|
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 Declare Function DeleteUrlCacheEntry Lib "wininet" Alias "DeleteUrlCacheEntryA" (ByVal lpszUrlName As String) As Long
Sub test()
Dim nUrl As String, localFilename As String, lngRetVal As Long
nUrl = "http://www.baidu.com/img/baidu_logo.gif" '要下载的文件链接
localFilename = ThisWorkbook.Path & Application.PathSeparator & "myimg.gif" '保存到本地的完整路径
DeleteUrlCacheEntry nUrl '清除缓存 |
|