Sub DownloadPic(url,strPath)
Set Winhttp = CreateObject("WinHttp.WinHttpRequest.5.1")
Winhttp.Open "GET", url
Winhttp.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"
Winhttp.Send
Set sGet = CreateObject("ADODB.Stream")
sGet.Mode = 3
sGet.Type = 1
sGet.Open()
sGet.Write(Winhttp.ResponseBody)
sGet.SaveToFile strPath
End Sub
在此将代码分享给大家。
原文:https://blog.51cto.com/181647568/2477546