using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication7
{
class Program
{
static void Main(string[] args)
{
try
{
int i = 1;
int j = 0;
Console.WriteLine(i / j);
}
catch(DivideByZeroException dze)
{
Console.WriteLine(dze.Message);
}
catch(Exception e)
{
Console.WriteLine("Error:"+e.Message);
}
finally
{
Console.WriteLine("Over");
}
}
}
}
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication7
{
class Program
{
static void Main(string[] args)
{
try
{
int i = 1;
int j = 0;
Console.WriteLine(i / j);
}
catch(Exception e)
{
Console.WriteLine("Error:"+e.Message);
}
catch (DivideByZeroException dze)
{
Console.WriteLine(dze.Message);
}
finally
{
Console.WriteLine("Over");
}
}
}
}
语句
except
on e: Exception do
Application.MessageBox('数据刷新错误!', '错误', MB_OK + MB_ICONSTOP);
end;