进程类不读取文件路径

时间:2018-10-29 00:48:55

标签: vb.net

我的代码是这样的:

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Process.Start("C:\Users\T\Desktop\IntSwitch\IntSwitch\IntSwitch\ipSwitchOnn.exe")
    End Sub

这是有效的,因为文件路径正确,但是有没有办法仅使用文件名?

这不起作用:

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Process.Start("ipSwitchOnn.exe")
    End Sub

但这将起作用:

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Process.Start("IExplore.exe")
    End Sub

该文件应该在哪里,以便我可以在没有复杂文件路径的情况下进行引用? 这样保存:

(IntSwitch)> IntSwitch.sln(IntSwitch)>

enter image description here

0 个答案:

没有答案