如何在WebBrowser控件中获取302重定向URL

如何在WebBrowser控件中获取302重定向URL

本文介绍了如何在WebBrowser控件中获取302重定向URL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想实现身份验证过程,我需要从重定向URL的查询参数中获取一些令牌值。该重定向URL在fiddler中具有302状态。但我无法在WebBrowser导航或任何其他
事件中获取该URL,直接我获得了跟随重定向URL的下一个URL。请告诉我如何在使用WebBrowser控件时捕获重定向URL。

I want to implement a authentication process and I need to get some token value from the query parameter of a redirection URL. That redirection URL is having 302 status in fiddler. But I am not able to get that URL in WebBrowser navigating or any other event, directly I am getting the next URL which is following redirection URL. Please let me know on how to capture redirect URL while using WebBrowser Control.

谢谢。

推荐答案

有一个关于你问过的类似帖子,试试这个帖子中的解决方案:
从原始URL获取重定向的URL
。您可以尝试导航事件,但这可能不足以满足您的要求,因为它在页面加载完成后获取重定向的URL,并且只能获取最后重定向的URL。  

There is a similar thread about you asked, try the solution in this thread: Getting the Redirected URL from the Original URL. You can have a try in the navigated event, but it may be not enough to your requirements,because it gets the redirected URL when the page load finished and it can only get the last redirected URL.  

此外, 链接:   用于Web浏览器控件的HTTP监视器,它是一个用于监视来自WebBrowser Control的http请求的开源DLL。我希望这个
可以提供帮助。

In addition,  Link:   HTTP Monitor for Webbrowser Control , it is an open source DLL to monitor http requests from WebBrowser Control. I hope this can be helpful.

最好的问候,


这篇关于如何在WebBrowser控件中获取302重定向URL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 04:50