C# wininet InternetSetOption
我正在使用 如何清除 System.Windows .Forms.WebBrowser 会话数据? 只要只有一个浏览器,它就可以工作。是否可以为同一应用程序中的 2 个 Web 浏览器控件提供各自的会话?
如果是这样,我只需要更改
InternetSetOption(IntPtr.Zero, INTERNET_OPTION_END_BROWSER_SESSION, IntPtr.Zero, 0);
为
InternetSetOption(webBrowser1.Handle, INTERNET_OPTION_END_BROWSER_SESSION, IntPtr.Zero, 0);
?
或者还需要什么东西吗?
I'm using How to clear System.Windows.Forms.WebBrowser session data? and it works as long as there is only one browser. Is it possible to give 2 web browser controls within the same application their own session?
If so, would I just need to change
InternetSetOption(IntPtr.Zero, INTERNET_OPTION_END_BROWSER_SESSION, IntPtr.Zero, 0);
to
InternetSetOption(webBrowser1.Handle, INTERNET_OPTION_END_BROWSER_SESSION, IntPtr.Zero, 0);
?
Or is something else required?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你试过了吗?我认为这是不可能的,因为会话是按浏览器实例存储的。也许您需要清除属于该控件的会话中的数据,然后您可以保留其他控件的会话数据。
Have you tried it yet? I don't think it's possible because the session is stored per browser instance. Maybe you need to clear the data from the session that belongs to that control, then you can keep session data of the other control.