在帮助文件中关于beforeaddfile事件
http://www.foxtable.com/help/topics/2638.htm
If e.DataCol.name = "文件" Then
If e.DataRow.IsNull("用户") = False
Dim pth As String = "c:\data\" & e.DataRow("用户")
If FileSys.DirectoryExists(pth) Then
e.Path = pth
Else
e.path = "c:\data"
End If
Else
e.path = "c:\data"
End
If
End
If
这段代码有点繁琐,可以优化代码为:
If e.DataCol.name = "文件" Then
e.path = "c:\data"
If not e.DataRow.IsNull("用户") andalso FileSys.DirectoryExists(e.path & e.DataRow("用户")) then
e.Path = e.path & e.DataRow("用户")
End If
End
If
[此贴子已经被作者于2012-10-24 19:41:37编辑过]