当我使用mono filename.exe
在使用gmcs filename.cs
进行编译后运行我的代码时,C#Console.ReadLine()
命令简单地被忽略。会发生什么?即使当我尝试运行简单的代码波纹管时,它会跳到最后,好像它什么都不跑。Console.ReadLine被跳过
static void Main(string[] args) {
string value = Console.ReadLine();
Console.WriteLine("You entered: {0}", value);
Console.WriteLine("Press ENTER to continue...");
Console.ReadLine(); // Returns immediately.
Console.WriteLine("Continuing....");
}
你是从mono开发运行的吗? – JaredPar 2013-03-16 03:22:10
您将此创建为控制台应用程序,对不对?不是一个Windows窗体或WPF应用程序? – 2013-03-16 03:50:09
我使用textWrangler创建了它,并使用mac上的控制台编译它。 – user2142733 2013-03-16 04:21:06