liusir
public static class WebBrowserExtensions
    {
        public static void SuppressScriptErrors(this WebBrowser webBrowser, bool hide)
        {
            FieldInfo fiComWebBrowser = typeof(WebBrowser).GetField("_axIWebBrowser2", BindingFlags.Instance | BindingFlags.NonPublic);

            if (fiComWebBrowser == null) return;

            object objComWebBrowser = fiComWebBrowser.GetValue(webBrowser);

            if (objComWebBrowser == null) return;

            objComWebBrowser.GetType().InvokeMember("Silent", BindingFlags.SetProperty, null, objComWebBrowser, new object[] { hide });

        }

    }

 

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-29
  • 2021-12-03
  • 2021-05-29
  • 2021-04-17
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-10
  • 2021-12-02
  • 2021-12-20
  • 2022-12-23
  • 2022-01-06
相关资源
相似解决方案