以文本方式查看主题 - 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=113586) |
-- 作者:szsmall -- 发布时间:2018/1/19 1:37:00 -- 复制选中文件,到指定文件夹 将文件表上选中的文件号,从pic复制到abc文件夹,代码怎么实现。 [此贴子已经被作者于2018/1/19 1:37:14编辑过]
|
-- 作者:y2287958 -- 发布时间:2018/1/19 8:19:00 -- 循环执行呗 |
-- 作者:有点甜 -- 发布时间:2018/1/19 8:46:00 -- Dim dt As DataTable = DataTables("文件表") For Each dr As DataRow In dt.Select("选择 = true") For Each f As String In FileSys.GetFiles(ProjectPath & "pic") If FileSys.GetName(f).StartsWith(dr("文件号")) Then FileSys.CopyFile(f, ProjectPath & "abc/" & FileSys.GetName(f), True) End If Next Next |
-- 作者:szsmall -- 发布时间:2018/1/19 10:34:00 -- 如果文件夹在其他盘,代码可以怎么写 因为ProjectPath ,是项目所在的文件夹,如下面代码,把路径写上去,会出现错误 For Each f As String In FileSys.GetFiles(ProjectPath & "D:\\pic") |
-- 作者:有点甜 -- 发布时间:2018/1/19 10:43:00 -- 这样写
For Each f As String In FileSys.GetFiles("D:\\pic") |