vb代码
vb不熟悉,用XMLHTTP 如何获取远程图片并显示在picturebox上 --------------------编程问答-------------------- 一般是获取到二进制数据后,保存到本地,再用LoadPicture载入 --------------------编程问答-------------------- 代码怎么写,网上找来的代码 好使Private Sub Command1_Click()
Dim a As New xmlHttp
a.open "GET", "http://www.baidu.com/img/baidu_logo.gif", False
a.setRequestHeader "User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)"
a.send
Do While a.readyState <> 4
DoEvents
Loop
Open "c:\1.gif" For Binary As #1
Put #1, , a.responseBody
Close #1
End Sub
能不能帮忙给修改一下 --------------------编程问答--------------------
Private Sub Command1_Click()--------------------编程问答-------------------- 不好意思,我是新手
Dim a As New xmlHttp, v() As Byte
a.Open "GET", "http://www.baidu.com/img/baidu_logo.gif", False
a.send
While a.readyState <> 4
DoEvents
Wend
v = a.responseBody
Open "c:\1.jpg" For Binary As #1
Put #1, , v
Close #1
Picture1.Picture = LoadPicture("c:\1.jpg")
End Sub
补充:VB , 网络编程