积极答复者
使用typeof(int)会出现异常

问题
答案
-
dear
这是 Type.GenericParameterAttributes 属性,不算是调用 typeof 后的异常
若你真的要捕捉,应该要这样用
try { var aa = typeof(int); var bb = aa.GenericParameterAttributes; } catch (Exception ex) { throw; }
秘訣無它,唯勤而已 http://www.dotblogs.com.tw/yc421206/
- 已标记为答案 Learning hard 2012年11月19日 4:10
全部回复
-
dear
这是 Type.GenericParameterAttributes 属性,不算是调用 typeof 后的异常
若你真的要捕捉,应该要这样用
try { var aa = typeof(int); var bb = aa.GenericParameterAttributes; } catch (Exception ex) { throw; }
秘訣無它,唯勤而已 http://www.dotblogs.com.tw/yc421206/
- 已标记为答案 Learning hard 2012年11月19日 4:10