Mac OS X上用CoreCLR运行一个真正的.NET控制台程序
这个真正的控制台程序来自 corefxlab ,名叫CoreClrHelloWorld,是一个跨平台的.NET控制台演示程序,可以显示微软、Linux、苹果的logo。 CoreClrHelloWorld代码如下(代码中省略了拼接logo的字符串,完整代码见 这里 ): using System; internal class Program { private static void Main(string[] args) { if (args.Length == 1 && args[0] == "linux") { DrawLinux(); } else if (args.Length == 1 && args[0] == "mac") { DrawMac(); } else { DrawWindows(); } Console.WriteLine(); Console.WriteLine("Press ENTER to exit ..."); Console.ReadLine(); } private static void DrawWindows() { Console.WriteLine("Hello, Windows..."); const int squareSize = 20; var colors = new[] { ConsoleColor.Red,