我的目标是通过单击按钮使用vb.net启动文件

时间:2016-04-18 13:30:47

标签: vb.net visual-studio

我的目标是通过点击按钮在vb.net中使用此文件启动文件..

System.Diagnostics.Process.Start("X:\Desktop\Brutal Doom\PLAY ME BRUTAL DOOM!!!.pk3") 

哪个有效,但是当我移动到我的笔记本电脑或另一台计算机时,按钮无法再找到该文件,因为驱动器号已更改..有没有办法对此进行编码,使其不再可靠驱动器号,只会看到\Brutal Doom\PLAM ME BRUTAL DOOM!!!.pk3因此在我放置文件夹的任何计算机上工作...

1 个答案:

答案 0 :(得分:1)

你基本上是在寻找这个吗? How to get a path to the desktop for current user in C#?System.Diagnostics.Process.Start(My.Computer.FileSystem.SpecialDirectories.Desktop & "\Brutal Doom\PLAY ME BRUTAL DOOM!!!.pk3")