using System;
namespace UserExceptionTest
{
public class MyException:Exception
{
public MyException() { }
public MyException(string message) : base(message) { }
public MyException(string message, Exception inner) : base(message, inner) { }
}
class Program
{
static void Main(string[] args)
{
throw new MyException("test exception");
}
}
}
C#创建用户自定义异常 user defined exception
最新推荐文章于 2023-05-12 15:38:00 发布