If e.Col.Name = "附件" Then
Dim ftp1 As New FtpClient
ftp1.Host = "*****"
ftp1.Account = "*****"
ftp1.Password = "*****"
ftp1.RenameEnabled = False \'禁用重命名文件按钮
ftp1.MakerDirEnabled = False \'禁用新建文件夹
If ftp1.DirExists("/data/caigou/" & e.Row("供应商") & "" & e.Row("采购单号") & "") Then
ftp1.ChangeDir("/data/caigou/" & e.Row("供应商") & "" & e.Row("采购单号") & "")
Else
ftp1.MakeDir("/data/caigou/" & e.Row("供应商") & "" & e.Row("采购单号") & "")
ftp1.ChangeDir("/data/caigou/" & e.Row("供应商") & "" & e.Row("采购单号") & "")
End If
ftp1.RootDir = "/data/caigou/" & e.Row("供应商") & "" & e.Row("采购单号") & "" \'设置根目录
ftp1.OpenManager()
Dim drs As List(Of String) = ftp1.GetFileList("/data/caigou/" & e.Row("供应商") & "" & e.Row("采购单号") & "")
Dim st As String = String.Join(",", drs.ToArray)
e.Row("附件") = st.Replace("/data/caigou/" & e.Row("供应商") & "" & e.Row("采购单号") & "/", " ")
End If
此主题相关图片如下:文件管理器3.png