Dim b() As Byte
Dim strPath As String
Inet2.URL = "http://www.office-cn.net/test.jpg"
strPath = App.Path & "/tmp.bmp"
b() = Inet2.OpenURL(, icByteArray)
Open strPath For Binary Access Write As #1
Put #1, , b()
Close #1
请问一下加在铵钮上是这样用的吗?
需要加插件吗?
Private Sub Command0_Click()
Public Sub SaveWebPicture(url As String, fileName As String)
Dim x As New XMLHTTP
Dim s As New ADODB.Stream
x.Open "GET", url, False
x.send
s.Type = 1
s.Open
s.Write x.responseBody
s.SaveToFile fileName
s.Close
Set x = Nothing
Set s = Nothing
End Sub
SaveWebPicture "http://cimg2.163.com/mobile/2008/3/18/160_129.jpg", "D:\Test.jpg"
End Sub
Public Sub SaveWebPicture(url As String, fileName As String)
Dim x As New XMLHTTP
Dim s As New ADODB.Stream
x.Open "GET", url, False
x.send
s.Type = 1
s.Open
s.Write x.responseBody
s.SaveToFile fileName
s.Close
Set x = Nothing
Set s = Nothing
End Sub
Private Sub Command0_Click()
SaveWebPicture "http://cimg2.163.com/mobile/2008/3/18/160_129.jpg", "D:\Test.jpg"
End Sub
提示
Dim x As New XMLHTTP
Dim s As New ADODB.Stream
错误