以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  怎么选中文件?  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=148600)

--  作者:mamuaiqing
--  发布时间:2020/4/10 20:47:00
--  怎么选中文件?
根据文件的路径,文件名,怎么实现打开目录后选定指定的文件?请教老师,谢谢
--  作者:y2287958
--  发布时间:2020/4/10 22:14:00
--  
Dim Proc As New Process
Dim wj As String = "d:\\test.xls"
Dim rs As String = "  /select," & wj & " "
\'output.Show(rs)
Proc.File = "explorer.exe" \'指定要执行的文件
Proc.Arguments = rs \'指定命令行参数
Proc.Start()

--  作者:有点蓝
--  发布时间:2020/4/11 10:03:00
--  
OpenFileDialog ?

Dim dlg As New OpenFileDialog \'定义一个新的OpenFileDialog 
dlg.Filter= 
"Excel文件|*.xls|Word文件|*.doc|Access文件|*.mdb" \'设置筛选器
dlg.Filter = "abc.xls"
If
 dlg.ShowDialog = DialogResult.Ok Then \'如果用户单击了确定按钮
    MessageBox.Show(
"你选择的是:" & dlg.FileName,"提示"\'提示用户选择的文件
End
 
If