Dim fp As String = "\gongling\web\FTP测试\" & Tables("表A").current("自制")
Dim sts As List(of String) = ftp.GetFileList(fp) '获取当前目录的文件列表
If sts.Count >0 Then
for each st as string in sts
If st = fname Then
MessageBox.Show("服务器上存在同名文件!","提醒")
Return '这里简化了操作, 可以自己做是否覆盖的功能
End If
next
e.form.text = "ftp管理器 文件上传中....”
If ftp.upload(dlg.FileName,ftp & "\" & fname) =Ture Then '若成功上传
Functions.Execute("刷新ListView“) ‘这个是自定义函数
e.Form.text = "ftp管理器"
MessageBox.Show("上传成功","提醒")
Else
MessageBox.Show("上传失败","提醒")
e.Form.text = "ftp管理器"
end if
end if