从命令行参数VB.NET获取文件路径 [英] Getting file path from command line argument, VB.NET

查看:152
本文介绍了从命令行参数VB.NET获取文件路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,

我想获取文件名,描述和版本。

据我所知,我必须定义文件的路径首先,得到文件信息。

所以我已经使用过FileVersionInfo类了,它工作得很好......



但我的问题是:如何获取这样的文件路径:

Rundll32.exe NvMCTray.dll,NvTaskbarInit - 登录

Rundll32.exe C:\ Windows \ system32 \ NvCpl.dll,NvStartup



如果有可能,请帮助我。



最好的问候,

Nana

Dear All,
I am trying to get File name, description and version.
As I know, I must define the path of the file First, to get the file information.
so I already used FileVersionInfo class, it's working pretty well...

but my problem is: how to get the file path from something like this:
"Rundll32.exe NvMCTray.dll,NvTaskbarInit - login"
"Rundll32.exe C:\Windows\system32\NvCpl.dll,NvStartup"

If is it possible, please help me.

Best Regards,
Nana

推荐答案

没有路径信息可以获取该命令行上的文件。



你唯一能做的就是获取你拥有的文件名,然后在硬盘上搜索文件,一次一个目录。



您可以通过假设找到文件来智能地搜索驱动器在PATH环境变量中的omewhere。首先搜索这些文件夹,如果找不到该文件,则必须搜索其余的目录结构,直到你这样做。



这可能需要一会儿。
There is no path information to get about the files on that command line.

The only thing you can do is grab the filename you have and then go searching the hard drive for the file, one directory at a time.

You can search the drive a bit more "intelligently" by assuming that the files will be found somewhere in the PATH environment variable. Search those folders first, and if you don't find the file, you'll have to search the rest of the directory structure until you do.

That could take a while.


这篇关于从命令行参数VB.NET获取文件路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆