by Alpha
3. April 2010 22:20
在使用的时候注意try块里面的代码顺序。 比如下面两段代码,输出结果不一样。 int a = 0;
DateTime dt;
try
{
a = 100;
dt = Convert.ToDateTime("alpha");
}
catch
{
}
Console.WriteLine(a.ToString());
上面这段代码输出100。
int a = 0;
DateTime dt;
try
{
...
[More]
25f97540-1f7b-4301-988a-adfb5d03d330|0|.0
Tags: try, catch Views:907
.Net相关