怎么用VB下载东西!

来源:百度知道 编辑:UC知道 时间:2024/09/22 05:27:22
做自动更新用` 点击一个按钮 实现下载一个文件
(如www.xxx.com/123.jpg)到根目录
(最好带ProgressBar)
求高手赐代码``

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

Private Sub Command1_Click()
Me.Hide
DoEvents
On Error Resume Next
URLDownloadToFile 0, "www.xxx.com/123.jpg", "c:\123.mp3", 0, 0
End Sub

BS you