一、主要用到以下几个API:
1、FindFirstUrlCacheEntry
2、FindNextUrlCacheEntry
3、FindCloseUrlCache
下面的内容摘自MSDN:
-------------------------------------------------------------------------------------------------------------------------------------------------------
Client
|
Requires WindowsVista, WindowsXP, Windows2000 Professional, WindowsNT Workstation4.0, WindowsMe, Windows98, or Windows95.
|
Server
|
Requires Windows Server"Longhorn", Windows Server2003, Windows2000 Server, or WindowsNT Server4.0.
|
Version
|
Requires Internet Explorer 3.0 or later.
|
Header
|
Declared in Wininet.h.
|
Library
|
Use Wininet.lib.
|
DLL
|
Requires Wininet.dll.
|
Unicode
|
Implemented as
FindFirstUrlCacheEntryW(Unicode) and
FindFirstUrlCacheEntryA(ANSI). Note that Unicode support on Windows Me/98/95 requires Microsoft Layer for Unicode.
|
Return code
|
Description
|
ERROR_INSUFFICIENT_BUFFER
|
The size of
lpNextCacheEntryInfoas specified by
lpdwNextCacheEntryInfoBufferSizeis not sufficient to contain all the information. The value returned in
lpdwNextCacheEntryInfoBufferSizeindicates the buffer size necessary to contain all the information.
|
ERROR_NO_MORE_ITEMS
|
The enumeration completed.
|
Client
|
Requires WindowsVista, WindowsXP, Windows2000 Professional, WindowsNT Workstation4.0, WindowsMe, Windows98, or Windows95.
|
Server
|
Requires Windows Server"Longhorn", Windows Server2003, Windows2000 Server, or WindowsNT Server4.0.
|
Version
|
Requires Internet Explorer 3.0 or later.
|
Header
|
Declared in Wininet.h.
|
Library
|
Use Wininet.lib.
|
DLL
|
Requires Wininet.dll.
|
Unicode
|
Implemented as
FindNextUrlCacheEntryW(Unicode) and
FindNextUrlCacheEntryA(ANSI). Note that Unicode support on Windows Me/98/95 requires Microsoft Layer for Unicode.
|
FindCloseUrlCache
This function closes the specified cache enumeration handle.
BOOL FindCloseUrlCache( HANDLE hEnumHandle );
Parameters
hEnumHandle
[in] Handle returned by a previous call to theFindFirstUrlCacheEntryfunction.
Return Values
Returns TRUE if successful, or FALSE otherwise.
Requirements
OS Versions:Windows CE 2.12 and later.
Header:Wininet.h.
Link Library:Wininet.lib.
DeleteUrlCacheEntry
This function removes the file associated with the source name from the cache, if the file exists.
BOOL DeleteUrlCacheEntry( LPCTSTR lpszUrlName );
Parameters
lpszUrlName
[in] Address of a string variable that contains the cache entry source name. The name string must be unique and cannot contain escape characters.
Return Values
Returns TRUE if successful, or FALSE otherwise.
Requirements
OS Versions:Windows CE 2.12 and later.
Header:Wininet.h.
Link Library:Wininet.lib.
DWORD dwStructSize;
LPTSTR lpszSourceUrlName;
LPTSTR lpszLocalFileName;
DWORD CacheEntryType;
DWORD dwUseCount;
DWORD dwHitRate;
DWORD dwSizeLow;
DWORD dwSizeHigh;
FILETIME LastModifiedTime;
FILETIME ExpireTime;
FILETIME LastAccessTime;
FILETIME LastSyncTime;
LPBYTE lpHeaderInfo;
DWORD dwHeaderInfoSize;
LPTSTR lpszFileExtension;
union {
DWORD dwReserved;
DWORD dwExemptDelta;
}; } INTERNET_CACHE_ENTRY_INFO,
*LPINTERNET_CACHE_ENTRY_INFO;
Value
|
Meaning
|
EDITED_CACHE_ENTRY
|
Cache entry file that has been edited externally. This cache entry type is exempt from scavenging.
|
SPARSE_CACHE_ENTRY
|
Partial response cache entry.
|
STICKY_CACHE_ENTRY
|
Sticky cache entry that is exempt from scavenging for the amount of time specified by
dwExemptDelta. The default value set by
CommitUrlCacheEntryis one day.
|
TRACK_OFFLINE_CACHE_ENTRY
|
Not currently implemented.
|
TRACK_ONLINE_CACHE_ENTRY
|
Not currently implemented.
|
Value
|
Meaning
|
COOKIE_CACHE_ENTRY
|
Cookie cache entry.
|
NORMAL_CACHE_ENTRY
|
Normal cache entry; can be deleted to recover space for new entries.
|
URLHISTORY_CACHE_ENTRY
|
Visited link cache entry.
|
Client
|
Requires WindowsVista, WindowsXP, Windows2000 Professional, WindowsNT Workstation4.0, WindowsMe, Windows98, or Windows95.
|
Server
|
Requires Windows Server"Longhorn", Windows Server2003, Windows2000 Server, or WindowsNT Server4.0.
|
Version
|
Requires Internet Explorer 3.0 or later.
|
Header
|
Declared in Wininet.h.
|
Unicode
|
Implemented as
INTERNET_CACHE_ENTRY_INFOW(Unicode) and
INTERNET_CACHE_ENTRY_INFOA(ANSI). Note that Unicode support on Windows Me/98/95 requires Microsoft Layer for Unicode.
|





































































































