呵呵.早上看到这个贴子时,写了一半的代码,结果发现贴子消失了..
怎么现在又冒出来了..
等等吧..我给你写.
完整代码来了:
==================================
'新建工程,1个按钮,1个text,1个Inet
'对text内容没做判断,对下载图片出错没做判断
'已测试,如果图片URL正确,且网络正确,程序是无问题的..
Private Sub Command1_Click()
Dim b() As Byte
Dim strURL As String
strURL = "
http://www.baidu.com/img/" & Text1
b() = Inet1.OpenURL(strURL, icByteArray)
If Len(Dir("d:\pic", vbDirectory)) = 0 Then MkDir ("d:\pic")
If Len(Dir("d:\pic\" & Date, vbDirectory)) = 0 Then MkDir ("d:\pic\" & Date)
Open "d:\pic\" & Date & "\" & Text1 For Binary Access Write As #1
Put #1, , b()
Close #1
Picture1.Picture = LoadPicture("d:\pic\" & Date & "\" & Text1)
MsgBox "完成了!"
End Sub
Private Sub Form_Load()
Text1 = "sslm1_logo.gif"
Command1.Caption = "下载了!"
End Sub本回答被提问者采纳