如何使用 VB.NET 从 CD 驱动器打开文件夹?
我正在尝试编写一个程序,当单击按钮时,该程序会从 CD 磁盘打开一个文件夹。该程序将从 CD 运行,旨在打开某个文件夹。但是,我无法使用“shell“explorer....””,因为驱动器号会在不同的计算机之间发生变化。有没有办法在VB.NET中直接从CD打开文件夹
I'm trying to write a program that opens a folder from the CD disk when a button is clicked. The program will be run from a CD, and aims to open a certain folder. However, I can't use "shell "explorer...."" because the drive letter will change between different computers. Is there a way to open the folder straight from the CD in VB.NET
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
如果您知道您的程序是从 CD 启动的,那就很容易了。只需读回程序位置:
It is easy if you know that your program was started from the CD. Just read the program location back:
例如,如果我想执行一个文件:executable.exe;
在光驱E:\executables\executable.exe")
代码:
Example, if I want execute an file: executable.exe;
In Optical drive E:\executables\executable.exe")
Code:
该链接包含一些基本内容。它应该为您指明正确的方向。另外,从代码示例中获取关键字并搜索 MSDN。 MSN 有大量文档和示例,可以帮助您进行下一步。
https:// /web.archive.org/web/1/http://articles.techrepublic%2ecom%2ecom/5100-10878_11-6081470.html#
编辑 - 试试这个...
This link contains some basic stuff. It should get you pointed in the right direction. Also, take keywords from the code sample and search MSDN. MSN has lots of documentation and samples that may get you to the next step.
https://web.archive.org/web/1/http://articles.techrepublic%2ecom%2ecom/5100-10878_11-6081470.html#
edit - try this...
您可以使用此代码:
You can using this code: