ftp当前目录切换不生效??
以下代码换行的时候执行
Dim ckmc As String = e.Form.Name
Dim zuoi As String= e.Form.Controls("zuoi").text
Dim zuo As Table = Tables(ckmc+"_"+zuoi)
Dim mulu As String = zuo.Current("djbh")
Dim tupian As WinForm.PictureViewer = e.Form.Controls("tupian")
Dim fujian As WinForm.FileManager = e.Form.Controls("fujian")
Dim tpftp As FTPClient = tupian.FTPclient
Dim fjftp As FTPClient = fujian.FTPclient
If tpftp.DirExists("/"+mulu+"/tupian") = False Then '新增根目录
tpftp.MakeDir("/"+mulu+"/tupian")
End If
tpftp.RootDir= "/"+mulu+"/tupian" '设置ftp根目录
tpftp.ChangeDir("/"+mulu+"/tupian") '将指定目录设定成当前目录
MessageBox.Show("/"+mulu+"/tupian") ‘这个获取到的是当前根目录,是正确的
MessageBox.Show(tpftp.CurrentDir) ’这个获取到的却是上一行的根目录,是错误的,两个获取的不一样
If tpftp.Connected= False Then
If tpftp.Connect Then '连接FTP
tupian.FTPclient = tpftp '如果连接成功,打开FTP客户端ftp.OpenManager() ,这里只赋值就好了
Else
Messagebox.show("连接FTP失败,重新打开窗口或者联系管理员!","警告",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
End If