[英]Check if application is started with given options
How do I make my program check if it launched with given options like this 我如何检查我的程序是否以这样的给定选项启动
"C:\\bla\\blabla\\myapp\\myapp.exe" -NoUpdateCheck -NoInt
“ C:\\ bla \\ blabla \\ myapp \\ myapp.exe” -NoUpdateCheck -NoInt
or 要么
"C:\\bla\\blabla\\myapp\\myshortcut.lnk" -NoUpdateCheck -NoInt
“ C:\\ bla \\ blabla \\ myapp \\ myshortcut.lnk” -NoUpdateCheck -NoInt
Or just with one option. 或者只是一种选择。
您使用System.Environment.Commandline读取完整的命令行并进行解析。
Use a command line argument parser and save yourself from re-inventing the wheel. 使用命令行参数解析器,避免重新发明轮子。 I use this one for everything : http://commandlinearguments.codeplex.com/
我用这个来做所有事情: http : //commandlinearguments.codeplex.com/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.