帮忙看看inet 为什么下载不了服务器上的文件?
Private Sub Command1_Click()Dim fso As Object, f As Object
Dim i As Integer, j As Integer, k As Integer, time_now As Integer, time_inter As Integer
Dim this_path As String
Dim dir_strs As Variant, dir_name As String
this_path = App.Path & "\source_data" & CStr(Int(10 * Rnd()))
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.CreateFolder(this_path)
With Me.Inet1
.URL = "ftp://134.230.48.218"
.UserName = "odd"
.Password = "odd"
Err.Clear
On Error Resume Next
.Execute , "dir *.xls"
If Err.Number > 0 Then
GoTo last_command
End If
While .StillExecuting = True
DoEvents
Wend
dir_name = vbNullString
dir_name = .GetChunk(0)
dir_strs = Split(dir_name, vbCrLf)
time_now = Year(Date) & Right("0" & Month(Date), 2) & Right("0" & Day(Date), 2)
End With
Form1.Inet1.Cancel
With Form1.Inet1
.URL = "ftp://134.230.48.218"
.UserName = "odd"
.Password = "odd"
For i = 4 To 5
MsgBox dir_strs(i)
dir_name = vbNullString
dir_name = dir_strs(i)
If Len(dir_name) > 10 Then
Err.Clear
On Error Resume Next
.Execute , "GET " & dir_strs(i) & " " & this_path & "\" & dir_strs(i)
MsgBox Err.Number
While .StillExecuting
DoEvents
Wend
End If
Next
End With
last_command:
End Sub
运行没问题,就是最后文件下载不了,是什么问题造成?
补充:VB , 网络编程