int k = Int16.Parse(args [0]);

解决方案 »

  1.   

    args [0])的实例呢?
    你先判断args的长度来试试.........
      

  2.   

    if(args.Lenght!=0)
    {
    再操作。
    }命令行有可能不传任何参数。
      

  3.   

    using System;
    public class One
    {

    static void Square(int i)
    {
    int m = i*i;
    Console.WriteLine("The Square of teh argument is {0}",m);
    }
    static void Main(String[] args)
    {
    Console.WriteLine("the program will convert your string argument to int and display the square of the number.");
                      if(args.Length>0)
                      {
       int k = Int32.Parse(args [0]);
       Square(k);
                      }
    }
    }
      

  4.   

    程序改
    if(args.Lenght!=0)
    {
    再操作。
    }

    if(args.Length>0)
    {
    再操作。    
    }
    但命令行不传任何参数。
    怎样对args [0])的实例????