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 Findfirstur Lcacheentry ([MarshalAs (UNMANAGEDTYPE.LPTSTR)] string urlsearchpattern, IntPtr lpfirstcacheentryinfo, ref int LPDWFI RstcacheentryinFobuffersize); [DllImport ("Wininet.dll", Setlasterror=true, CharSet=CharSet.Auto)] public static extern bool Geturlcacheentryi NFO ([MarshalAs (UNMANAGEDTYPE.LPTSTR)] string lpszurlname, IntPtr lpcacheentryinfo, ref int Lpdwcacheentryin
Fobuffersize); 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); }