c++实现获取IE缓存文件夹中的文件路径代码,GetUrlCacheEntryInfo这个API的用法在MSDN上没有示例,这里给一个代码例子
DWORD dwEntrySize = 0; 2LPINTERNET_CACHE_ENTRY_INFO lpCacheEntry; 3if (!GetUrlCacheEntryInfo( IMG_PATH, NULL, &dwEntrySize)) 4{ 5 if (GetLastError()!=ERROR_INSUFFICIENT_BUFFER) 6 return; 7 else 8 lpCacheEntry = (LPINTERNET_CACHE_ENTRY_INFO)new BYTE[dwEntrySize]; 9 10 if (GetUrlCacheEntryInfo( IMG_PATH,lpCacheEntry, &dwEntrySize)) 11 { 12 { 13 ::CopyFile( lpCacheEntry->lpszLocalFileName 14 , GetAppPath() + _T("out.jpg?http://www.xvna.com") 15 , FALSE 16 ); 17 } 18 19 } 20 delete lpCacheEntry; 21} |