Original: http://blog.csdn.net/Modest/archive/2008/06/04/2510834.aspx
Option explicit <br/> private declare function geturlcacheentryinfo lib "wininet. DLL "alias" geturlcacheentryinfow "(byval szurlname as long, byref lpcacheentryinfo as any, byref lpdwcacheentryinfobuffersize as long) as long <br/> private declare function sysallocstring lib "oleaut32.dll" (byval polechar as long) as string <br/> private type filetime <br/> dwlowdatetime as long <br/> dwhighdatetime Long <br/> end type <br/> private type inte_cache_entry_info <br/> dwstructsize as long <br/> lpszsourceurlname as long <br/> lpszlocalfilename as long <br/> cacheentrytype as long <br/> dwusecount as long <br/> dwhitrate as long <br/> dwsizelow as long <br/> dwsizehigh as long <br/> lastmodifiedtime as filetime <br/> expiretime as filetime <br/> lastaccesstime as filetime <br/> lastsynctime as fil Etime <br/> lpheaderinfo as long <br/> dwheaderinfosize as long <br/> lpszfileextension as long <br/> dwreserved as long <br/> end type <br/> private declare sub copymem lib "Kernel32" alias "rtlmovememory" (destination as any, source as any, byval length as long) <br/> .) <Br/> Public Function getcachepath (lpszurl as string) as string <br/> dim dwentrysize as long <br/> dim lpcacheentry as inte_cache_entry_info <br/> dim Tarr () as byte <br/> call geturlcacheentryinfo (strptr (lpszurl), byval 0, dwentrysize) <br/> If dwentrysize> 0 then <br/> redim Tarr (0 to dwentrysize) <br/> call geturlcacheentryinfo (strptr (lpszurl), Tarr (0), dwentrysize) <br/> copymem byval lpcacheentry, Tarr (0), Len (lpcacheentry) <br/> getcachepath = sysallocstring (lpcacheentry. lpszlocalfilename) <br/> getcachepath = strconv (getcachepath, vbfromunicode) <br/> end if <br/> end Function