Dim ftp1 As New FTPClient
ftp1.Host= "192.168.1.206"
ftp1.Account = "lan"
ftp1.Password = "232400"
ftp1.Port = 2121
ftp1.RootDir = "\tp"
Dim nm As String = Tables(e.Form.Name & "_table1").Current("_identify") & ".jpg"
Dim pth As String = ProjectPath & "pictures\" & nm
For Each file As String In ftp1.GetFileList("\tp")
MessageBox.Show(1111)
If file <> nm Then
If ftp1.Upload(pth,"\tp\" & nm) = False Then
Messagebox.show("上传失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
End If
Next
请教一下各位老师,为什么这段代码执行之后,当ftp上的tp文件夹为空的时候就无法上传图片,但是只要tp文件夹有一张图片就可以上传