2

Possible Duplicate:
Clear temporary internet files via “C#”
How to clear browser cache programmatically?

I am trying to delete a file from Environment.SpecialFolder.InternetCache by iterating all directories of this folders and deleting all files in these directories. The problem is that it doesn't delete .tmp and index.dat files as they are locked by Windows itself.

My question is that: Is there any work around for deleting .dat and .tmp files OR Can I read Index.dat file and delete the entry of specific file which I want to delete from IE Cache?

Note: I want to this from C# desktop application not through ASP.NET

Cœur
  • 37,241
  • 25
  • 195
  • 267
awatan
  • 1,182
  • 15
  • 33
  • I have tried the above posted solution before posting my question but on DeleteUrlCacheEntry() mathod it gives error "Attempted to read or write protected memory. This is often an indication that other memory is corrupt." I have tried to google it but havent found concrete solution. – awatan Jul 05 '12 at 06:26
  • Checkout the following solution: [Clear IE Cache - C#](http://www.dreamincode.net/code/snippet1574.htm) – Himanshu Jul 04 '12 at 13:06

0 Answers0