Clear IE Cache with InetCpl.cpl, ClearMyTracksByProcess

I have an application that hosts a webbrowser control that clears the cache (regularly) using the sample code provided by my microsoft: http://support.microsoft.com/kb/262110

However, I noticed that after the cache is damaged or does not work properly (requests that must be outside the cache) are called again and again.

When I run the following command, the application starts normally. system ('RunDll32.exe InetCpl.cpl, ClearMyTracksByProcess 8')

Are these two the same, or is the code missing?

+2
source share
1 answer

In IE9, I ran InetCpl.cpl, ClearMyTracksByProcess 8, and it didn’t delete the thing, so it looks like MS has moved the target messages again.

Below is some very nice code that I got that should work in IE7, but if you need code that does the trick on win7 and IE8 / 9 then click on my name

public static class ClearMyTracks { /* * To clear IE temporary Internet files – ClearMyTracksByProcess 8 * To clear IE browsing cookies – ClearMyTracksByProcess 2 * To clear IE browsing history – ClearMyTracksByProcess 193 (ALSO deletes add on history) * To clear IE form data- ClearMyTracksByProcess 16 * To clear IE remembered passwords for filling web login forms-ClearMyTracksByProcess 32 * To clear or delete all IE browsing history – all of above!- ClearMyTracksByProcess 255 * To clear IE Tracking- ClearMyTracksByProcess 2048 * Preserve Favourites use 8192 * To clear IE Downloaded Files- ClearMyTracksByProcess 16384 * http://www.howtogeek.com/howto/windows/clear-ie7-browsing-history-from-the-command-line/ */ public enum ClearFlags { DeleteCookies = 2, DeleteHistoryFiles = 8, DeleteFormData = 16, DeletePasswords = 32, DeleteHistory = 193, DeleteALLHistory = 255, DeleteTrackingInfo = 2048, PreserveFavourites = 8192, DeleteDownloadHistory = 16384, DeleteEverything = 22783 }; public static void IEClearHistory(bool PreserveFavs, bool TempFiles, bool Cookies, bool History, bool form, bool passwords, bool downloads) { uint mask = 0; if (PreserveFavs) mask |= (uint)ClearFlags.PreserveFavourites; if (TempFiles) mask |= (uint)ClearFlags.DeleteHistoryFiles; if (Cookies) mask |= (uint)ClearFlags.DeleteCookies; if (History) mask |= (uint)ClearFlags.DeleteHistory; if (form) mask |= (uint)ClearFlags.DeleteFormData; if (passwords) mask |= (uint)ClearFlags.DeletePasswords; if (downloads) mask |= (uint)ClearFlags.DeleteDownloadHistory; if (mask != 0) System.Diagnostics.Process.Start("rundll32.exe", "InetCpl.cpl,ClearMyTracksByProcess " + mask.ToString()); } 
+5
source

All Articles