Foxtable(狐表)用户栏目专家坐堂 → 附件批量导出


  共有2187人关注过本帖树形打印复制链接

主题:附件批量导出

帅哥,在线噢!
有点蓝
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:106142 积分:539827 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By: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

 回到顶部
帅哥,在线噢!
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:106142 积分:539827 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By: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

 回到顶部
帅哥,在线噢!
有点蓝
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:106142 积分:539827 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By: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

 回到顶部