以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  如何打开指定文件夹下面任何一个文件?  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=188637)

--  作者:ZJZK2018
--  发布时间:2023/10/8 8:50:00
--  如何打开指定文件夹下面任何一个文件?
如何打开指定文件夹下面任何一个文件?
如文件夹(名称:工程类)下有文件:AA,DF,GL,

Dim dlg As New OpenFileDialog
dlg.Filter = "资料文件|*.doc;*.docx;*.xls;*.xlsx;*.png;*.dwg;*.pdf;*.jpg;*.zip;*.rar;*.HzTbs;"
If dlg.ShowDialog = DialogResult.OK Then
    Dim flnm As String = dlg.FileName                          \'要添加的文件名
    Dim pth As String = ProjectPath & "Attachments\\工程类\\"
    If FileSys.DirectoryExists(pth) = False Then       \'判断指定的目录是否存在
        FileSys.CreateDirectory(pth)                   \'创建目录
    End If
End If

Dim Proc As New Process \'打开文件
Proc.File = fl
Proc.Start()


--  作者:有点蓝
--  发布时间:2023/10/8 8:59:00
--  
Dim dlg As New OpenFileDialog
dlg.Filter = "资料文件|*.doc;*.docx;*.xls;*.xlsx;*.png;*.dwg;*.pdf;*.jpg;*.zip;*.rar;*.HzTbs;"
dlg.InitialDirectory = ProjectPath & "Attachments\\工程类\\"
If dlg.ShowDialog = DialogResult.OK Then
    Dim Proc As New Process \'打开文件
Proc.File = dlg.FileName
Proc.Start()
End If