我对如何做到这一点有点困惑。我想要做的是当我单击时Button1
,我的程序将在资源管理器中打开一个文件夹,第二个按钮将打开一个文件作为文本文件。
这是我的代码:
按钮 1
Process.Start("explorer.exe", Application.ExecutablePath + "\mvram.biz")
按钮 2
Process.Start("Notepad.Exe", "README.txt")
我的问题是每次单击按钮时都会打开“我的文档”。它必须打开 APPpath+特定文件夹。
编辑:
Public Class Form1
Private Sub ExcisionButtonDefault5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExcisionButtonDefault5.Click
Me.Close()
End Sub
Private Sub ExcisionButtonDefault1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExcisionButtonDefault1.Click
Dim path As String = System.IO.Path.GetDirectoryName(Application.ExecutablePath) & "\mvram.biz\"
Process.Start("explorer.exe", path)
End Sub
Private Sub ExcisionButtonDefault2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExcisionButtonDefault2.Click
Process.Start("explorer.exe", Application.StartupPath & "\Documents")
End Sub
Private Sub ExcisionButtonDefault3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExcisionButtonDefault3.Click
Process.Start("Notepad.Exe", "/select," & "README.txt")
End Sub
Private Sub ExcisionButtonDefault4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExcisionButtonDefault4.Click
Process.Start("explorer.exe", System.Windows.Forms.Application.StartupPath + "\Presentation")
End Sub
Private Sub ExcisionButtonDefault6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExcisionButtonDefault6.Click
System.Diagnostics.Process.Start("http://www.mvram.biz")
End Sub
End Class