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
错误
请问一下加在铵钮上是这样用的吗?
需要加插件吗?
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