WinForms WebBrowser 控件检测重定向

标签 winforms webbrowser-control

是否有任何方法可以检测我不知道的 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/

相关文章:

debugging - AOL 桌面的浏览器控制台?

c# - 如何在 WPF Webbrowser 控件上停用 "right click"?

c# - 如何从 gridview 将多条记录添加到 SQL Server 表中?

c# - Windows Forms 和 Aero 不能很好地结合——如何使它们看起来像原生的?

c# - 在 WebBrowser 控件中设置输入标签的值

c# - 将 WebBrowser 控件内容保存为 HTML

vb.net - 确定是否在 WebBrowser 控件中滚动到页面底部

c# - 关于 "GUI in C# and code in C++"

c# - 限制 MDI 应用程序中的窗口实例数

C# Windows 窗体线程 : My form seems not to run as own thread