打印本文 打印本文 关闭窗口 关闭窗口
Check if a File is in Internet Explorers Cache
作者:武汉SEO闵涛  文章来源:敏韬网  点击数821  更新时间:2009/4/23 10:51:17  文章录入:mintao  责任编辑:mintao

Description

This function can be called to determine if a file is in Internet Explorers cache.

Code

Private Declare Function GetUrlCacheEntryInfo Lib "wininet.dll" Alias _
    "GetUrlCacheEntryInfoA" _
    (ByVal sUrlName As String, _
    lpCacheEntryInfo As Any, _
    lpdwCacheEntryInfoBufferSize As Long) As Long

Function Cached(ByVal strURL As String) As Boolean
    Dim buffer As Long
    
    If (GetUrlCacheEntryInfo(strURL, ByVal 0&, buffer)) = 0 Then
    If (Err.LastDllError = 122) Then Cached = True
        
End Function

 

Example Usage

Just call the function and give it the url of the file you want to check:

MsgBox Cached("http://msdn.microsoft.com/")

打印本文 打印本文 关闭窗口 关闭窗口