web浏览器弹出窗口失去会话弹出窗口、浏览器、web

2023-09-06 06:06:49 作者:独行归.

我使用.NET的WebBrowser控件登录到网站。当我点击一个按钮,弹窗的新窗口弹出窗口要求我重新登录。但是我没有要求重新登录,如果我打开Internet Explorer中的网页。有没有什么办法让WebBrowser控件存储会话,这样我就不必在弹出的窗口中重新登录。

I am using WebBrowser control of .NET to login into a website. When i click on a button that popups a new window the popup window asks me to login again. However i am not asked to login again if i open the webpage in internet explorer. Is there any way to make the WebBrowser control store session so that i do not have to login again on the popup window.

推荐答案

要保持你的的会话状态可以的使用 NewWindow2 事件,打开在应用程序的另一种形式的新页;该事件由 web浏览器控制触发。

To maintain the session state you can use the NewWindow2 event to open the new page in another form in the application; the event is triggered by the WebBrowser control.

请参阅如何使用 web浏览器控制NewWindow2事件在Visual C#

See How to use the WebBrowser control NewWindow2 event in Visual C#