【问题标题】:How to capture captcha image object with DotNetBrowser如何使用 DotNetBrowser 捕获验证码图像对象
【发布时间】:2019-08-22 07:32:59
【问题描述】:

我们在 DotNetBrowser 上显示的网站包含验证码图像元素。在代码元素中捕获此元素图像类型的方法是什么?

网址:https://paydas.its.gov.tr/hesap_yonetimi/giris

browserView = new WinFormsBrowserView(BrowserFactory.Create(BrowserType.LIGHTWEIGHT));
//...
browserView.Browser.SetSize(1024, 768); 
Bitmap screenshot = browserView.Browser.ImageProvider.GetImage() as Bitmap; 
DOMElement captchaElement = browserView.Browser.GetDocument().GetElementById("imgCaptcha"); 
pictureBox1.Image = screenshot?.Clone(captchaElement.BoundingClientRect, screenshot.PixelFormat);

这种方法不健康。

【问题讨论】:

    标签: c dotnetbrowser


    【解决方案1】:

    我找到了解决办法。

    我在创建 Browser 对象后添加了以下代码 sn-p。

    int viewHeight = 20000;
                string[] switches = {
                        "--disable-gpu",
                        "--max-texture-size=" + viewHeight
                };
    BrowserPreferences.SetChromiumSwitches(switches);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-04-01
      • 1970-01-01
      • 1970-01-01
      • 2011-08-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多