Process.Start(screenreaderPath) 没有停留在屏幕上
Process.Start(screenreaderPath) not staying on screen
Private Sub Button8_Click(sender As Object, e As EventArgs) Handles Button8.Click
Dim screenreaderPath As String = IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "help.exe")
Process.Start(screenreaderPath)
当我单击按钮时,它会加载但不会停留在屏幕上。相反,它只是消失了。谁能解释一下为什么?
由于这是一个命令行应用程序,您可以直接加载 cmd.exe 并向其传递 /k 参数,该参数告诉 Windows 保持 cmd 打开:
Private Sub Button8_Click(sender As Object, e As EventArgs) Handles Button8.Click
Dim screenreaderPath As String = IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "help.exe")
Dim oProcess As New Process
Dim pi As ProcessStartInfo = New ProcessStartInfo()
pi.Arguments = " /k """ & screenreaderPath & """"
pi.FileName = "cmd.exe"
oProcess.StartInfo = pi
oProcess.Start()
End Sub
Private Sub Button8_Click(sender As Object, e As EventArgs) Handles Button8.Click
Dim screenreaderPath As String = IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "help.exe")
Process.Start(screenreaderPath)
当我单击按钮时,它会加载但不会停留在屏幕上。相反,它只是消失了。谁能解释一下为什么?
由于这是一个命令行应用程序,您可以直接加载 cmd.exe 并向其传递 /k 参数,该参数告诉 Windows 保持 cmd 打开:
Private Sub Button8_Click(sender As Object, e As EventArgs) Handles Button8.Click
Dim screenreaderPath As String = IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "help.exe")
Dim oProcess As New Process
Dim pi As ProcessStartInfo = New ProcessStartInfo()
pi.Arguments = " /k """ & screenreaderPath & """"
pi.FileName = "cmd.exe"
oProcess.StartInfo = pi
oProcess.Start()
End Sub