Dim str1 As String
str1= FileSys.GetName(dlg.FileName)
If ftp1.DirExists(str) Then
ftp1.ChangeDir(str)
If ftp1.FileExists(str1) = True Then
MessageBox.Show("已有重名文件")
Return
Else
If ftp1.Upload(dlg.FileName) = True Then
Messagebox.show("上传完成!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
e.form.controls("TextBox4").text = FileSys.GetName(dlg.FileName)
Else
Messagebox.show("上传失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
End If
为什么红色那段代码没有效果,我里面已经有个名为1的文件了,但是还能上传,是不是因为目录的原因呢?