我正在 linux mint 14 上使用 MONO (C#) 构建应用程序,但我有一些问题。我在选项中启用了外部控制台,并且在调试时它工作得很好,但是在部署之后(在调试文件夹中打开 .exe),应用程序在 Console.ReadLine(); 之后立即退出。有什么想法吗?
public static void InitializeUI()
{
Console.WriteLine("On the bottom line enter the command \"START\" followed by a space and a number representing on how many hours to check for new posts. You can always stop the execution with Ctrl+C \r\n \r\nExample : START 6");
ParseCMD();
Console.ReadLine ();
}
private static void ParseCMD()
{
string cmd = Console.ReadLine();
string[] commands = cmd.Trim().Split(new string[] {" "},StringSplitOptions.RemoveEmptyEntries);
int delay = 0;
if (commands[0].ToLower() == "start" && int.TryParse(commands[1],out delay))
{
MainLogic.StartLogic(delay);
}
else
{
Console.WriteLine("Wrong command");
ParseCMD();
}
}
后退出
string cmd = Console.ReadLine();