3

i need to Clear cache and Cookies for all WebBrowser Controls in a tabbed WebBrowser. I can't use run32dll to do this.

After googled a little i found this :

    private const int INTERNET_OPTION_END_BROWSER_SESSION = 42;

    [DllImport("wininet.dll", SetLastError = true)]
    private static extern bool InternetSetOption(IntPtr hInternet, int dwOption, IntPtr lpBuffer, int lpdwBufferLength); 

InternetSetOption(IntPtr.Zero, INTERNET_OPTION_END_BROWSER_SESSION, IntPtr.Zero, 0);

First of all what does it clear? Cookie only or cache too?

Then Does it delete the cache and cookies for all webControl in the controls?

I need to delete cache for some website before open a tab and then when i need to close all the tabs i want clear cache and cookie for all webControl.

If i call tabs.TabPages.clear(); and i close all webBrowsers did i clean Cache and Session?

Thanks

user1107078
  • 455
  • 1
  • 7
  • 18
  • This might be related: http://stackoverflow.com/questions/1688991/how-to-set-and-delete-cookies-from-webbrowser-control-for-arbitrary-domains – DuckMaestro Jan 25 '12 at 23:00

0 Answers0