一看就明白了:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
private void MyFun()
{
throw new System.ArgumentException("数据库文件错误");
}
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
try
{
MyFun();
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
}


被折叠的 条评论
为什么被折叠?



