开发者

How to get the response headers while the user navigates from page to page?

开发者 https://www.devze.com 2022-12-14 15:34 出处:网络
I have a WPF webbrowser control which navigates the user to a registration site. After the user registers, a collection of headers are sent back alongwith the \"finished registration\" page.

I have a WPF webbrowser control which navigates the user to a registration site. After the user registers, a collection of headers are sent back alongwith the "finished registration" page.

I have tried the Navigated event, and tried accessing WebRe开发者_如何学Csponse property in the event arguments but it's always null.

Is there any other way to access the headers sent?


After quite a lot of reading, I figured out that WPF web browser actually wraps around the WinForm web browser which inturn wraps around a COM dll (which is even used by Internet Explorer).

Now this COM dll provides a lot of interfaces which are not exposed by any of the wrapper controls. So those who need more control need to implement these interfaces.

I found a browser which implements a lot of these interfaces and neatly provides a lot functionality. Used it and it's working fine. http://www.codeproject.com/KB/miscctrl/csEXWB.aspx

It talks about implemnting a PassthroughAPP package to get the response headers.


I dont think you can access headers like that, best thing to do is, either use Hidden Fields of the form or you can pass on your cookie ASP.NET_SessionID from your finished page to your WPF app, and inside WPF app you can make custom request to your url with same ASP.NET_SessionID cookie where you will continue same session and you will be able to query responses you desire throught WebResponse.

0

精彩评论

暂无评论...
验证码 换一张
取 消