有没有办法从 webwiev 网站复制验证码图像,然后将其粘贴到 imagewiev 中?我曾经在 VB.NET 中工作,所以我正在尝试一些新的东西。这是代码形式 vb :
Private Sub captcha()
Dim doc As mshtml.IHTMLDocument2 = WebBrowser1.Document.DomDocument
Dim imgrange As mshtml.IHTMLControlRange = CType(doc.body, mshtml.HTMLBody).createControlRange
For Each img As mshtml.IHTMLImgElement In doc.images
If img.getattribute("src").ToString.Contains("jkjkhjkhjk") Then
imgrange.add(img)
imgrange.execCommand("copy", False, Nothing)
PictureBox1.Image = Clipboard.GetDataObject.GetData(DataFormats.Bitmap)
Exit For
End If
Next
End Sub