图片都在你的ie缓存里面,找到缓存文件copy过来就可以了
//using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)]
public struct INTERNET_CACHE_ENTRY_INFO
{
public int dwStructSize;
public IntPtr lpszSourceUrlName;
public IntPtr lpszLocalFileName;
public int CacheEntryType;
public int dwUseCount;
public int dwHitRate;
public int dwSizeLow;
public int dwSizeHigh;
public FILETIME LastModifiedTime;
public FILETIME ExpireTime;
public FILETIME LastAccessTime;
public FILETIME LastSyncTime;
public IntPtr lpHeaderInfo;
public int dwHeaderInfoSize;
public IntPtr lpszFileExtension;
public int dwExemptDelta;
}
[DllImport("wininet.dll", SetLastError=true, CharSet=CharSet.Auto)]
public static extern IntPtr FindFirstUrlCacheEntry([MarshalAs(UnmanagedType.LPTStr)] string UrlSearchPattern, IntPtr lpFirstCacheEntryInfo, ref int lpdwFirstCacheEntryInfoBufferSize);
[DllImport("wininet.dll", SetLastError=true, CharSet=CharSet.Auto)]
public static extern bool GetUrlCacheEntryInfo( [MarshalAs(UnmanagedType.LPTStr)] string lpszUrlName, IntPtr lpCacheEntryInfo, ref int lpdwCacheEntryInfoBufferSize );
public static string GetCatchFileName(string url)
{
int nNeeded = 0, nBufSize;
IntPtr buf;
FindFirstUrlCacheEntry( null, IntPtr.Zero, ref nNeeded );
nBufSize = nNeeded; buf = Marshal.AllocHGlobal( nBufSize );
GetUrlCacheEntryInfo(url,buf,ref nNeeded);
INTERNET_CACHE_ENTRY_INFO CacheItem;
GetUrlCacheEntryInfo(url,buf,ref nNeeded);
CacheItem = (INTERNET_CACHE_ENTRY_INFO) Marshal.PtrToStructure( buf,typeof(INTERNET_CACHE_ENTRY_INFO) );
string res=Marshal.PtrToStringAuto(CacheItem.lpszLocalFileName);
return(res);
}