C#???????????????????
???????????? ???????[ 2013/11/28 11:06:46 ] ????????
??????????????????о????鷳???????????дtry??catch???????????????????????дtry/catch?????????????????????EntLib??????????????д?????????????ExceptionHandle???????????????????л?????????????????????????????????????????????????????????????????? ????????????????μ??????????д????μ?????????????д????????????????????????????????????????????????????????????
class Program
{
delegate void delegateTest(int x?? int y);
delegate double dosomethings();
static void Main(string[] args)
{
ExceptionHandle(dividetest?? 1?? 0);
ExceptionHandle1(() => { int x = 1; int y = 0; double z = x / y; return z; });
Console.ReadKey();
}
static void dividetest(int x?? int y)
{
double z = x / y;
}
static void ExceptionHandle1(dosomethings ds)
{
try
{
double z = ds();
Console.Write(z);
}
catch (DivideByZeroException dex)
{
Console.WriteLine(dex.Message);
}
}
static void ExceptionHandle(delegateTest dt??int x?? int y)
{
try
{
dt(x?? y);
}
catch (DivideByZeroException dex)
{
Console.WriteLine(dex.Message);
}
}
}
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11