问题描述
- C# WebBrowser_BeforeNavigate2获取不到post数据
-
private void frmMain_Load(object sender, EventArgs e){
SHDocVw.WebBrowser wb = (SHDocVw.WebBrowser)webBank.ActiveXInstance; wb.BeforeNavigate2 += new DWebBrowserEvents2_BeforeNavigate2EventHandler(wb_BeforeNavigate2);
}
private void wb_BeforeNavigate2(object pDisp, ref object URL, ref object Flags, ref object TargetFrameName, ref object PostData, ref object Headers, ref bool Cancel)
{
//无法触发
string postDataText = System.Text.Encoding.ASCII.GetString(PostData as byte[]);}
解决方案
before navigate只能拿到将要访问的URL,这个时候还没访问,拿不到post数据。
解决方案二:
能否给个实例不???
时间: 2025-01-19 02:57:12