以文本方式查看主题
- Foxtable(狐表) (http://foxtable.com/bbs/index.asp)
-- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2)
---- 如何实现多文件的下载 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=118425)
|
-- 作者:小骨头ror
-- 发布时间:2018/5/2 17:02:00
-- 如何实现多文件的下载
Dim s1 As String = Tables("ITSM_事件").Current("附件") If FileSys.FileExists(ProjectPath & "Reports\\" & s1) Then \'如果本地存在同名文件且CRC校验值相同 \'则直接使用本地文件 Else \'否则从数据库提取文件 Network.DownloadFile("http://220.171.107.58:280/itsm/" & s1 , ProjectPath & "Reports\\" & s1 ,"" ,"" ,True, 100000, True) End If Dim Proc As New Process \'打开文件 Proc.File = ProjectPath & "Reports\\" & s1 Proc.Start()
以下是代码,只能实现一个文件下载,遇见多个文件下载就会报以下错误
此主题相关图片如下:)_1wya6jks5)mbo_xo56d.png

怎么实现多个文件下载?
|
-- 作者:有点甜
-- 发布时间:2018/5/2 17:07:00
--
For Each s1 As String In Tables("ITSM_事件").Current.DataRow.Lines("附件") If FileSys.FileExists(ProjectPath & "Reports\\" & s1) Then \'如果本地存在同名文件且CRC校验值相同 \'则直接使用本地文件 Else \'否则从数据库提取文件 Network.DownloadFile("http://220.171.107.58:280/itsm/" & s1 , ProjectPath & "Reports\\" & s1 ,"" ,"" ,True, 100000, True) End If Dim Proc As New Process \'打开文件 Proc.File = ProjectPath & "Reports\\" & s1 Proc.Start() Next
|
-- 作者:小骨头ror
-- 发布时间:2018/5/2 18:02:00
--
谢谢老师 我用的是SelectedIndexChanged的属性
现在出现的问题就是我选择一个文件打开 结果就是所有文件都打开了 有没有办法解决呀
|
-- 作者:小骨头ror
-- 发布时间:2018/5/2 18:05:00
--
此主题相关图片如下:}6mcs9e@o5xwj%j5{hlu1v.png

|
-- 作者:有点甜
-- 发布时间:2018/5/2 18:08:00
--
Dim s1 As String = e.Sender.Text
If FileSys.FileExists(ProjectPath & "Reports\\" & s1) Then \'如果本地存在同名文件且CRC校验值相同
\'则直接使用本地文件
Else \'否则从数据库提取文件
Network.DownloadFile("http://220.171.107.58:280/itsm/" & s1 , ProjectPath & "Reports\\" & s1 ,"" ,"" ,True, 100000, True)
End If
Dim Proc As New Process \'打开文件
Proc.File = ProjectPath & "Reports\\" & s1
Proc.Start()
|
-- 作者:小骨头ror
-- 发布时间:2018/5/3 12:50:00
--
解决了 感谢老师的指导
|