老师已实现上传和关联,还想再完善一下实现改名,怕不同人传的附件在同一FTP文件夹下重名了。
Dim CODE As WinForm.TextBox = e.Form.Controls("TextBox10")
Dim flm As WinForm.FileManager = e.Form.Controls("FileManager1")
Dim ftp1 As New FtpClient
ftp1.Host="196.128.143.28"
ftp1.Account = "foxuser"
ftp1.Password = "138238110"
If ftp1.Upload(e.Form.Controls("textbox2").value,"\ZZZJ\" & "CODE.text" & FileSys.GetName(e.Form.Controls("textbox2").value)) = True Then (改名规则为 code.text + 当前日期时间 + 上传的文件名 )
Messagebox.show("上传完成!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Else
Messagebox.show("上传失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
flm.AddFile(FileSys.GetName(e.Form.Controls("textbox2").value)) 此处也对应上面改的名称
试了修改代码没改正确,请老师再帮看看那里怎么重命名组合、