以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  多文件列增加文件无法复制  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=53162)

--  作者:tongyong1969
--  发布时间:2014/7/1 12:00:00
--  多文件列增加文件无法复制
表中附件列为多文件列
在表属性BeforeAttachFile事件设置代码,希望增加的文件能存放在新建的文件夹中,

Select Case e.DataCol.name
Case "附件"
Dim yy As String = Format(Date.Today(),"yyyy")
Dim mm As String = Format(Date.Today(),"MM")
Dim bh As String =Format(Date.Today(),"yyyyMMdd")
For i As Integer= 1 To 10000
     Dim d As String ="d:\\works\\资料\\" & yy &"\\" & mm & "\\" & bh & format(i,"0000") 
     If not FileSys.DirectoryExists(d) Then
        FileSys.CreateDirectory(d)
        e.SubFolder=d  
        Exit For
     End If
Next
End Select


运行时能建立了新的文件夹,但出现错误信息:The given path\'s format is not supported.
增加文件无法复制到指定文件夹


--  作者:Bin
--  发布时间:2014/7/1 12:06:00
--  
看起来不应该啊. 上个例子看看

既然可以创建说明路径是没问题的, 是不是你文件名有问题.带有\\

--  作者:有点甜
--  发布时间:2014/7/1 12:30:00
--  

 这句代码,e.SubFolder=d  指定的是子目录,只能是定义好的存放目录下的目录,不能是绝对路径的。

 

 http://www.foxtable.com/help/topics/2209.htm

 


--  作者:tongyong1969
--  发布时间:2014/7/1 12:40:00
--  
实例
--  作者:tongyong1969
--  发布时间:2014/7/1 12:53:00
--  
可以了,在附件列属性设置存放目录"d:\\works\\资料\\,代码设置为e.SubFolder=yy &"\\" & mm & "\\" & bh & format(i,"0000") ,谢谢