码迷,mamicode.com
首页 > 其他好文 > 详细

DownLoadImage

时间:2017-08-05 23:34:30      阅读:145      评论:0      收藏:0      [点我收藏+]

标签:box   name   end   lib   gre   private   entry   清除缓存   log   

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 DownloadImage(ByVal ImageUrl As String, ByVal ImagePath As String)
    Dim lngRetVal As Long
    lngRetVal = URLDownloadToFile(0, ImageUrl, ImagePath, 0, 0)
    If lngRetVal = 0 Then
        DeleteUrlCacheEntry ImageUrl  ‘清除缓存
        ‘MsgBox "成功"
    Else
        ‘MsgBox "失败"
    End If
End Sub

  

DownLoadImage

标签:box   name   end   lib   gre   private   entry   清除缓存   log   

原文地址:http://www.cnblogs.com/nextseven/p/7291766.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!