再发生异常后,保持对程序的控制力

using System;
using System.Collections.Generic;
using System.Text;

namespace 异常捕获
{
    
class Program
    
{
        
static void Main(string[] args)
        
{
            
int a = 1;
            
int b = 0;
            
try
            
{
                a 
= a / b;
            }

            
catch (System.DivideByZeroException e)
            
{
                Console.WriteLine(e.Message);
            }

        }

    }

}

posted on 2007-08-18 10:12  ATP.NET  阅读(178)  评论(0编辑  收藏  举报