惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 聂微东
GbyAI
GbyAI
G
Google Developers Blog
大猫的无限游戏
大猫的无限游戏
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园 - 叶小钗
A
About on SuperTechFans
M
MIT News - Artificial intelligence
宝玉的分享
宝玉的分享
雷峰网
雷峰网
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Martin Fowler
Martin Fowler
Google DeepMind News
Google DeepMind News
博客园 - Franky
B
Blog RSS Feed
Y
Y Combinator Blog
Stack Overflow Blog
Stack Overflow Blog
MongoDB | Blog
MongoDB | Blog
Last Week in AI
Last Week in AI
T
The Blog of Author Tim Ferriss
The GitHub Blog
The GitHub Blog
S
SegmentFault 最新的问题
罗磊的独立博客
Apple Machine Learning Research
Apple Machine Learning Research

博客园 - bullfinch

Notes of "The Unbridged Pentium 4" - Pentium 4 System Overview Notes of "The Unbridged Pentium 4" - Pentium 4 Road Map Notes of "The Unbridged Pentium 4" - Overview of the Processor Role Notes of "Pentium Processor System Architecture" - Pentium Signal Interface (part) Notes of "Pentium Processor System Architecture" - Mutiple Processors and the MESI Model Notes of "Pentium Processor System Architecture" - The Functional Units & Pentium Cache Overview AMD Opteron Architecture related Fedora Core 3 挂载FAT32分区以及中文显示和输入 摄像头设置事件 linux下安装HP NC6000无线网卡(HP W500) C#学习笔记(八) TreeView.AfterCheck和TreeNode.Checked赋值的问题 C#学习笔记(七) C#学习笔记(五) 图像中密集点群的定位 C#学习笔记(四) 中兴ZXDSL831立式蓝猫自动拨号+NAT+DHCP设置 关于变参(zz) C#学习笔记(三)
C#学习笔记(六)
bullfinch · 2005-03-18 · via 博客园 - bullfinch

1) 用throw来提示发生异常情况,如果CLR找不到exception handler,会中止当前函数,退栈,直到找到exception handler为止。

2) exception handler被称为一个catch block,用catch关键字来创建,和try block配合使用。

3) 当异常被抛出,程序立即转移到catch block,try block中的后续代码将不再有机会被执行到。

4) catch后加括号可以指定所针对的exception,同时需要注意catch的顺序和exception之间的继承关系。

5) 不同通用性的handler可以放在不同层次的方法中。

6) finally block可以保证被执行到,无论是否遇到异常。finally必须和try block一起出现,且finally blcok不可通过break, continue, eturn, goto来中止。

7) Exception对象有Message, HelpLink和StackTrace属性。

8) 所有的自定义Exception都必须派生自System.ApplicationExceptioin。

9) InnerException属性可以记录rethrow过程中内层的exception。

10) throw;表示把相同的exception直接抛出。