CellButtonClick
Select Case e.Col.Name
Case "资质证书","LOGO","业务章","公章","报告章"
Dim drr As DataRow = Functions.Execute("服务器","FTP服务器",e.Row("创建时间"))
If drr IsNot Nothing Then
e.Col.DataCol.FTPClient.host = drr("IP")
e.Col.DataCol.FTPClient.Account = drr("用户名")
e.Col.DataCol.FTPClient.password = drr("密码")
Dim fls As String = "\资质证书_" & e.Row("_Id")
If e.Col.DataCol.FTPClient.Connected = False '如果FTP没有连接
If e.Col.DataCol.FTPClient.Connect Then '连接FTP
If e.Col.DataCol.FTPClient.DirExists(fls) = False Then
e.Col.DataCol.FTPClient.MakeDir(fls)
End If
Else
drr("故障") = True
drr("故障时间") = Date.Now
drr.Save()
MessageBox.Show("无法连接服务器,稍后再试!")
e.Cancel = True
End If
End If
e.Col.DataCol.FTPClient.RootDir = fls
e.Col.DataCol.FTPClient.ChangeDir(fls)
End If
End Select
远程文件在表里打开不会报错,而在记录窗口RecordGrid打开时会报错连接失败,