【VB.NET】执行外部ExE文件
Dim info As System.Diagnostics.ProcessStartInfo
info = New System.Diagnostics.ProcessStartInfo()
info.FileName = [exe文件名]
info.Arguments = [执行参数]
info.WorkingDirectory = Application.StartupPath
Dim Proc As System.Diagnostics.Process
Try
Proc = System.Diagnostics.Process.Start(info)
Catch ex As System.ComponentModel.Win32Exception
Return
End Try
If Proc.HasExited = False Then
'Proc.Kill()
End If
info = New System.Diagnostics.ProcessStartInfo()
info.FileName = [exe文件名]
info.Arguments = [执行参数]
info.WorkingDirectory = Application.StartupPath
Dim Proc As System.Diagnostics.Process
Try
Proc = System.Diagnostics.Process.Start(info)
Catch ex As System.ComponentModel.Win32Exception
Return
End Try
If Proc.HasExited = False Then
'Proc.Kill()
End If
![]() | 本作品采用 知识共享署名-非商业性使用 2.5 中国大陆许可协议进行许可。 |