Private Sub Command1_Click()
  Inet1.Execute "http://www.mgccn.com/upgrade/mgdatpatch.exe", "GET mgdatpatch.exe c:\pwin98\desktop\mgdatpatch.exe"end subPrivate Sub Inet1_StateChanged(ByVal State As Integer)
Dim vtData As Variant
Dim bDone As Boolean: bDone = False
   
   Select Case State      Case 12      Tx = "c:\pwin98\desktop\mgdatpatch.exe"
      Do While Not bDone
         vtData = Inet1.GetChunk(1024, icByteArray)
         DoEvents
         Close #112
         Open Tx For Binary Access Write As #112
         For i = 1 To UBound(vtData)
             Tt = vtData(i)
             mFileCode = mFileCode + 1
             Put #112, mFileCode, Tt
         Next
         Close #112
      '''''''''''''''''''''''''''''''''''
         If Len(vtData) = 0 Then
            bDone = True
         End If
      Loop
      
   End SelectEnd Sub

解决方案 »

  1.   

    试试我这个函数吧,以前写的
    Private Function downloadOneFile(Inet_Dowload As Inet, fileURL As String, localFile As String)
    Dim FileNum     As Integer
        'download
        Dim b() As Byte
        FileNum = FreeFile
        b() = Inet_Dowload.OpenURL(fileURL, icByteArray)
    On Error Resume Next
        Open localFile For Binary Access Write As #FileNum
        Put #FileNum, , b()
        Close #FileNum
    End Function