Dim f As String = ProjectPath & "合格证\" & Tables("基本信息表").Current("出厂编号") & ".*" Dim exist As Boolean = False For Each fname As String In filesys.GetFiles(FileSys.GetParentPath(f)) If fname Like f Then exist = True Dim Proc As New Process '定义一个新的Process Proc.File = f '指定要打开的文件 Proc.Start() Exit For End If Next If exist = False Then msgbox("文件不存在") End If