Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- WebBrowser1.Navigate("URL", "", paramInByte, "Content-Type:application/x-www-form-urlencoded")
- 'scroll to the picture, so we have a WebBrowser object just like a picture box
- For Each i As HtmlElement In w.Document.GetElementsByTagName("img")
- If i.GetAttribute("src").Contains("here string to identify captcha image") Then
- i.ScrollIntoView(True)
- End If
- Next
- 'Create bitmap
- Dim bmp As New Bitmap(w.Width, w.Height, Imaging.PixelFormat.Format32bppArgb)
- Dim g As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(bmp)
- Dim hdc As IntPtr = g.GetHdc
- 'Do the Drawing
- Dim pUnk As IntPtr = System.Runtime.InteropServices.Marshal.GetIUnknownForObject(w.ActiveXInstance)
- OLE32.OleDraw(pUnk, 1, hdc, New Rectangle(0, 0, w.Width, w.Height))
- System.Runtime.InteropServices.Marshal.Release(pUnk)
- 'Release DC and dispose
- g.ReleaseHdc(hdc)
- g.Dispose()
- Public Class OLE32
- Public Declare Function OleDraw Lib "ole32.dll" (ByVal pUnk As IntPtr, ByVal dwAspect As Integer, ByVal hdcDraw As IntPtr, ByRef lprcBounds As Rectangle) As Integer
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement