using System;
namespace C13_4
{
public class Program
{
static int z = 0;
public static void Main()
{
try
{
int i = 10 / z;
}
catch (ArgumentOutOfRangeException e)
{
Console.WriteLine("例外資訊A:{0}:", e);
}
catch (ArgumentException e)
{
Console.WriteLine("例外資訊B:{0}:", e);
}
/*
捕獲所有例外資訊
catch
{
}
catch(Exception e)
{
}
*/
}
}
}
沒有留言:
張貼留言