'需引用 Microsoft Internet Transfer Control
'定位于 C:/Windows/System32/MSINET.OCX
Private bInetCode As Boolean
'Inet 延迟等待
Private Sub Inet_Wait()
While Inet.StillExecuting
DoEvents
Wend
End Sub
Private Sub FtpFile(ByRef Host As String, ByRef SourceFile As String, ByRef TragetFile As String)
Dim TempFile As String
TempFile = "./ls.txt"
With Inet
' .RemoteHost = ""
.RemotePort = 21
.AccessType = icDirect
.Protocol = icFTP
' .RequestTimeout = 1000
' .UserName = ""
' .Password = ""
End With
Inet.Execute Host, "SIZE " & SourceFile
Inet_Wait
If Not bInetCode Then GoTo CancelKey
Inet.Execute Host, "GET " & SourceFile & "