双击桌面中的快捷方式时,如何在应用程序中获取快捷方式的名称?
问题描述:
我想从快捷方式获取参数,您可以通过API函数和Interop.IWshRuntimeLibrary获取它,如果在c#中知道快捷方式的名称;但是当更改快捷方式的名称时,它将不会获得参数请帮忙!谢谢
I want to get the param from a shortcut,you can get it by API function and Interop.IWshRuntimeLibrary if shortcut''s name is known in c#;But when the shortcut''s name is changed,it will not to get the param; please help !Thanks
答
您是否要获取命令行参数?
如果是这样,则可以使用Environment.CommandLine
或Environment.GetCommandLineArgs()
,或者像这样声明您的Main
方法:
Are you trying to get the command line parameters?
If so, you can useEnvironment.CommandLine
orEnvironment.GetCommandLineArgs()
, or declare yourMain
method like this:
static void Main( string[] args )
尼克
Nick