Winforms 在Winform应用程序中使用WinInet清除多个WebBrowser控件的Cookie缓存

Winforms 在Winform应用程序中使用WinInet清除多个WebBrowser控件的Cookie缓存,winforms,caching,cookies,controls,browser,Winforms,Caching,Cookies,Controls,Browser,我需要清除选项卡式WebBrowser中所有WebBrowser控件的缓存和cookie。 我无法使用run32dll来执行此操作 在谷歌搜索了一下后,我发现: private const int INTERNET_OPTION_END_BROWSER_SESSION = 42; [DllImport("wininet.dll", SetLastError = true)] private static extern bool InternetSetOption(Int

我需要清除选项卡式WebBrowser中所有WebBrowser控件的缓存和cookie。 我无法使用run32dll来执行此操作

在谷歌搜索了一下后,我发现:

    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);
首先,它清楚什么?只有Cookie还是缓存

那么它是否会删除控件中所有webControl的缓存和cookie

我需要删除一些网站的缓存,然后再打开一个标签,然后当我需要关闭所有的标签,我想清除缓存和cookie的所有网络控制

如果我调用
tabs.TabPages.clear()我关闭了所有WebBrowser我清理了缓存和会话了吗

谢谢

这可能与: