class1.cs

来自「c#精彩编程百例(源代码)」· CS 代码 · 共 38 行

CS
38
字号
namespace ConsoleApp_CommandLine
{
    using System;

    /// <summary>
    ///    Summary description for Class1.
    /// </summary>
    public class Class1
    {
        public Class1()
        {
            //
            // TODO: Add Constructor Logic here
            //
        }

        public static int Main(string[] args)
        {
            //
            // TODO: Add code to start application here
            //
			int x=args[0].ToInt16();
			switch(x)
			{
				case 0:Console.WriteLine("Command Line Parameter is {0}",args[0]);
			           Console.WriteLine("You are 0"); 
					break;
				case 1:Console.WriteLine("Command Line Parameter is {0}",args[0]);			
					   Console.WriteLine("You are 1");
					break;
				default:
					break;
			}
            return 0;
        }
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?