using System;
namespace test
{
/// <summary>
/// 例外処理
/// </summary>
class Class1
{
static void Main(string[] args)
{
//
DivideByZero();
}
private static void DivideByZero()
{
try
{
int divZero = 0;
int n = 100/divZero;
}
catch (Exception e)
{
Type type = e.GetType();
Console.WriteLine("Exception Type = {0}", type.ToString());
Console.WriteLine("Exception Message = {0}", e.Message);
Console.WriteLine("Exception StackTrace = {0}", e.StackTrace);
}
}
}
}
|