2个回答
展开全部
'调用一个API函数就可以了啊
Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
'将图片保存到D盘
Private Sub Command1_Click()
URLDownloadToFile 0,ByVal "http://www.baidu.com/search/img/rss_xml.jpg",ByVal "d:\1.jpg" ,0,0
Msgbox "现在完成",,"提示"
End Sub
Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
'将图片保存到D盘
Private Sub Command1_Click()
URLDownloadToFile 0,ByVal "http://www.baidu.com/search/img/rss_xml.jpg",ByVal "d:\1.jpg" ,0,0
Msgbox "现在完成",,"提示"
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
AiPPT
2024-09-19 广告
2024-09-19 广告
随着AI技术的飞速发展,如今市面上涌现了许多实用易操作的AI生成工具1、简介:AiPPT: 这款AI工具智能理解用户输入的主题,提供“AI智能生成”和“导入本地大纲”的选项,生成的PPT内容丰富多样,可自由编辑和添加元素,图表类型包括柱状图...
点击进入详情页
本回答由AiPPT提供
展开全部
Private Sub Command1_Click()
Dim myData() As Byte, i&, myURL$
myURL = "https://gss0.bdstatic.com/70cFsjip0QIZ8tyhnq/img/logo-zhidao.gif"
If Inet1.StillExecuting = True Then Exit Sub
myData() = Inet1.OpenURL(myURL, icByteArray)
For i = Len(myURL) To 1 Step -1
If Left$(Right$(myURL, i), 1) = "/" Then RealFile$ = Right$(myURL, i - 1)
Next
Open "c:\1.gif" For Binary Access Write As #1
Put #1, , myData()
Close #1
Picture1.Picture = LoadPicture("c:\1.gif")
End Sub
Private Sub Form_Load()
Picture1.AutoSize = True
End Sub
Private Sub Form_Unload(Cancel As Integer)
If Dir("c:\1.gif") <> "" Then Kill "c:\1.gif"
End Sub
Dim myData() As Byte, i&, myURL$
myURL = "https://gss0.bdstatic.com/70cFsjip0QIZ8tyhnq/img/logo-zhidao.gif"
If Inet1.StillExecuting = True Then Exit Sub
myData() = Inet1.OpenURL(myURL, icByteArray)
For i = Len(myURL) To 1 Step -1
If Left$(Right$(myURL, i), 1) = "/" Then RealFile$ = Right$(myURL, i - 1)
Next
Open "c:\1.gif" For Binary Access Write As #1
Put #1, , myData()
Close #1
Picture1.Picture = LoadPicture("c:\1.gif")
End Sub
Private Sub Form_Load()
Picture1.AutoSize = True
End Sub
Private Sub Form_Unload(Cancel As Integer)
If Dir("c:\1.gif") <> "" Then Kill "c:\1.gif"
End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询