是否有任何方法可以检测我不知道的 Web 浏览器控件中的 302 重定向?也许是某种带有底层非托管控制的魔法?
最佳答案
不,普通的 WebBrowser 控件不可能做到这一点。使用底层非托管控件做任何事情看起来都非常复杂,如果这就是您想要的,您可以看看 http://www.codeproject.com/KB/miscctrl/csEXWB.aspx不过:
csEXWB is a C# .NET 2.0 control that creates, hosts and sinks the events of the original Webbrowser control (Not .NET or any other wrapper). Advanced customization and total control over the Webbrowser control are achieved via implementation of a number of interfaces, along with the addition of many methods, properties, events and a COM library.
这包括能够查看页面标题,这是您需要执行的操作来检测 HTTP 重定向。
关于WinForms WebBrowser 控件检测重定向,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4019731/