Managing cookies in a WPF WebBrowser control?

后端 未结 6 691
终归单人心
终归单人心 2020-12-18 03:02

Is there a way to read/write the cookies that a WebBrowser control uses?

I am doing something like this...

string resultHtml;
HttpWebRequest requ         


        
6条回答
  •  借酒劲吻你
    2020-12-18 03:28

    You can use Application.GetCookie and Application.SetCookie methods.

    Although Application is more or less related to WPF, you can use these methods in any desktop .NET code. In fact, they are wrappers on InternetGetCookieEx and InternetSetCookieEx Windows APIs.

提交回复
热议问题