文件路径两个例子不同,用那一个?
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
假定当前行“用户”列的内容为“张三”,单击增加按钮,出现的增加文件对话框,就会自动定位到"c:\data\张三"这个目录。
示例二
使用FTP进行远程文件管理时,一样可以设置添加文件的初始目录,例如:
If
e.DataCol.name =
"文件"
Then
If e.DataRow.IsNull("用户") =
False
e.path = "/data/" &
e.DataRow("用户")
End
If
End
If
示例三