解决方案 »

  1.   


    int i = int.Parse(Console.ReadLine());
      

  2.   

    读取控制台输入用的Console.ReadLine()
    判断是否数字
    int i;
    string input = Console.ReadLine().Trim();
    if(input.Length != 0 && int.TryParse(input, out i))
    {
    }
      

  3.   

    应该用int.TryParse(input, out i)判断正确
      

  4.   

    如果你是问怎么限制只输入整数。那么有办法。
            private void IntBool_KeyPress(object sender, KeyPressEventArgs e)
            {
                if ((int)e.KeyChar >= 48 && (int)e.KeyChar <= 57 && textBox.Text.Length < 18 || (int)e.KeyChar == 8) //只能输入0-9数字和BackSpace
                {
                    e.Handled = false;
                }
                else
                {
                    e.Handled = true;
                }
            }
      

  5.   

    实现功能 。用的是int.Parse(Console.ReadLine()):但是出现了
      

  6.   

    输入整数,或者 加try {m=。。} catch {。。}
      

  7.   

    知道怎么回事了 再加一个Console.WriteLine();就行了