program.cs
来自「c#开发宝典 光盘内容。本光盘主要为书中的源程序」· CS 代码 · 共 28 行
CS
28 行
using System;
using System.Collections.Generic;
using System.Text;
namespace Example6_8 {
class Program {
static void Main(string[] args) {
try {
IndexOutOfRangeException e = new IndexOutOfRangeException();
throw e;
} catch (IndexOutOfRangeException e) {
Console.WriteLine("出现了IndexOutOfRangeException异常,请检查代码,确认有无数组索引超出范围的情况!");
Console.WriteLine(e.Data.ToString());
Console.WriteLine(e.HelpLink);
Console.WriteLine(e.InnerException == null ? "" : e.InnerException.ToString());
Console.WriteLine(e.Message);
Console.WriteLine(e.Source);
Console.WriteLine(e.StackTrace);
Console.WriteLine(e.TargetSite.ToString());
} finally {
Console.WriteLine("程序运行完毕!");
}
Console.ReadLine();
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?