我想在Visual Studio 2008中调试一个程序。问题是,如果它没有获取参数,它就会退出。这是从主要方法:如何在调试时使用参数启动程序?
if (args == null || args.Length != 2 || args[0].ToUpper().Trim() != "RM")
{
Console.WriteLine("RM must be executed by the RSM.");
Console.WriteLine("Press any key to exit program...");
Console.Read();
Environment.Exit(-1);
}
我不想评论它,然后回来编译时。如何在调试时使用参数启动程序?它被设置为启动项目。
[Visual Studio C#传递命令行参数]可能的重复(http://stackoverflow.com/questions/6475887/passing-command-line-parameters-with-visual-studio-c-sharp) – horns 2015-05-04 13:49:45
可能的重复[用Visual Studio中的命令行参数调试](http://stackoverflow.com/questions/298708/debugging-with-command-line-parameters-in-visual-studio) – 2015-10-15 09:24:15