异常

来源:互联网 发布:nginx反向代理有什么用 编辑:程序博客网 时间:2024/05/29 13:58

try

{   int I = Convert.ToInt32(‘abc’)

}

catch (Exceptionex)

{   Console.WriteLine(“数据错误:” + ex.Message + “  “  +ex.StackTrace);

}

Console.ReadKey();

 

If (age < 0)

  { throw new Exception(“You come from other world”);

  }

原创粉丝点击