分享到新浪微博 分享到QQ空间 打印

[转载] [VB]利用URLDownloadToFile函数从网上下载文件到本机

[VB]利用URLDownloadToFile函数从网上下载文件到本机

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
Public Function DownloadFile(URL As String, LocalFilename As String) As Boolean
   Dim lngRetVal As Long
   lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0)
   If lngRetVal = 0 Then DownloadFile = True
End Function
Private Sub Form_Load()
  DownloadFile "http://www.chinavb.net/upload/qqskin.rar", "c:\qqskin_downok.rar"
End Sub
谁不怀念苏联,谁就没有良心;谁想回到苏联,谁就没有头脑.

Woodu.ME--从零开始的博客生活

TOP