以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  附件批量导出  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=141752)

--  作者:nxhylczh
--  发布时间:2019/10/10 11:19:00
--  
for each dr as row in tbl.rows            \'循环行  
     Dim lst As List(Of String) =  dr.Lines("文件管理")  \'获取文件集合
     循环 Lst
         用FileSys.CopyFile() 复制到批定的目录


[此贴子已经被作者于2019/10/10 11:21:19编辑过]

--  作者:有点蓝
--  发布时间:2019/10/11 8:57:00
--  
Dim dlg As New FolderBrowserDialog
Dim f As String = Tables("表A").Cols("文件管理").DataCol.DefaultFolder
If f Is Nothing Then
    f = ProjectPath & "Attachments\\"
Else
    f = f & "\\"
End If
If dlg.ShowDialog = DialogResult.Ok Then
    msgbox(dlg.SelectedPath )
    For Each r As Row In Tables("表A").rows
        Dim file = f & r("文件管理")
        If FileSys.FileExists(file) Then
            FileSys.CopyFile(file,dlg.SelectedPath & r("文件管理"),True)
        Else
            msgbox("文件不存在:" & file)
        End If
    Next
End If

--  作者:有点蓝
--  发布时间:2019/10/11 9:44:00
--  
Dim dlg As New FolderBrowserDialog
Dim f As String = ProjectPath & "RemoteFiles"
If dlg.ShowDialog = DialogResult.Ok Then
    msgbox(dlg.SelectedPath )
    Dim ftp As FTPClient = Tables("产品资料库_资料信息").Cols("文件管理").DataCol.FTPClient
    For Each r As Row In Tables("产品资料库_资料信息").rows
        Dim file = f & r("文件管理").replace("/","\\")
        If FileSys.FileExists(file) Then
            msgbox(dlg.SelectedPath & FileSys.GetName(r("文件管理")))
            FileSys.CopyFile(file,dlg.SelectedPath & FileSys.GetName(r("文件管理")),True)
        Else
            If ftp.Download(r("文件管理"),dlg.SelectedPath & FileSys.GetName(r("文件管理")))
                Messagebox.show("下载完成!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
            Else
                Messagebox.show("下载失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
            End If
        End If
    Next
End If

--  作者:有点蓝
--  发布时间:2019/10/11 14:10:00
--  
你连什么是ftp都还不懂,5楼的用法明显是共享文件,被你忽悠了。

Dim dlg As New FolderBrowserDialog
Dim f As String = Tables("产品资料库_资料信息").Cols("文件管理").DataCol.DefaultFolder
If f Is Nothing Then
    f = "\\\\192.168.1.10\\d\\生产数据\\信息管理系统\\管理文件\\"
Else
    f = f & "\\"
End If
msgbox(f)
If dlg.ShowDialog = DialogResult.Ok Then
    msgbox(dlg.SelectedPath )
    For Each r As Row In Tables("产品资料库_资料信息").rows
        Dim file = f & r("文件管理").replace("/","\\")
        If FileSys.FileExists(file) Then
            FileSys.CopyFile(file,dlg.SelectedPath & r("文件管理"),True)
        Else
            msgbox("文件不存在:" & file)
        End If
    Next
End If