Function for obtaining the local file path from Temporary Internet Files Through URL

Source: Internet
Author: User
Tags filetime

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.