如题,能不能仅仅使用api函数就能完成一个下载的任务并且有完整的消息回报,比如知道何时下载了多少

解决方案 »

  1.   

    你的要求有点高
    你可以试试DoFileDownload api就是调用ie下载文件的对话框,有进度条
      

  2.   

    使用非常简单
    Private Declare Function DoFileDownload Lib "shdocvw.dll" (ByVal lpszFile As String) As Long
    Private Sub Form_Load()
       DoFileDownload StrConv("http://www.blanksoft.com/", vbUnicode)
    End Sub
     
      

  3.   

    也可以用Inet控件,可以一点一点从缓存中拿,这样便于控制进度。不过一条语句完成不了,得用循环,不是很简便。
      

  4.   

    最好仅仅使用api函数,如果使用inet是不是最后需要打包呢
      

  5.   

    URLDownloadToFile的最后一个参数
      

  6.   

    看了一下msdn上的帮助,用URLDownloadToFile实现真的很麻烦,关注中!!
    URLDownloadToFile calls the caller's IBindStatusCallback interface to provide notifications during the binding process. In particular, URLDownloadToFile calls IBindStatusCallback::OnProgress to report the ongoing status of the download. The caller does not need not implement any of the notification callbacks for the function to succeed, but doing so allows the client to receive notifications, if interested, and also allows downloads to be canceled by returning E_ABORT from the OnProgress call.
      

  7.   

    我也用DoFileDownload 也用Inet控件,但……就是做不好,所以只能帮 顶!~
      

  8.   

    http://www.mvps.org/emorcillo/vb6/inet/adl.shtml
      

  9.   

    http://www.activevb-archiv.de/downloadstore/klassen/cdownload/cdownload.zip
    有一个例子(有小错,你自己修改以下),没有用URLDownloadToFile(用它的话,实现接口比较麻烦)