我想在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