[转载]vb.net获取web验证码在winform中显示的简单示例 - Konimeter - 博客园

[转载]vb.net获取web验证码在winform中显示的简单示例 – Konimeter – 博客园.

Private Sub GetImage()
        Try
            Dim request As HttpWebRequest = WebRequest.Create("http://www.junjv.com/GetImage")
            request.Timeout = 20000
            request.ServicePoint.ConnectionLimit = 100
            request.ReadWriteTimeout = 30000
            request.Method = "GET"
            Dim response As HttpWebResponse = request.GetResponse()
            If (response.StatusCode <> HttpStatusCode.OK) Then
                Exit Sub
            End If
            Dim resStream As Stream = response.GetResponseStream()
            PictureBox1.Image = New Bitmap(resStream) '这个是winform中的控件
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub

 

赞(0) 打赏
分享到: 更多 (0)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏