HttpWebRequest 抓圖片放在picturebox1
Dim url As String = "你要的網址" Dim req As System.Net.HttpWebRequest = DirectCast(System.Net.WebRequest.Create(url), System.Net.HttpWebRequest) Dim rsp As System.Net.HttpWebResponse = DirectCast(req.GetResponse(), System.Net.HttpWebResponse) Try If rsp.StatusCode = System.Net.HttpStatusCode.OK Then PictureBox1.Image = New Bitmap(rsp.GetResponseStream()) End If Finally rsp.Close() End Try
文章標籤
全站熱搜
留言列表