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

推荐订阅源

D
DataBreaches.Net
J
Java Code Geeks
有赞技术团队
有赞技术团队
H
Hackread – Cybersecurity News, Data Breaches, AI and More
The GitHub Blog
The GitHub Blog
T
The Blog of Author Tim Ferriss
Apple Machine Learning Research
Apple Machine Learning Research
量子位
D
Docker
V
Visual Studio Blog
博客园 - 司徒正美
Martin Fowler
Martin Fowler
人人都是产品经理
人人都是产品经理
WordPress大学
WordPress大学
U
Unit 42
M
MIT News - Artificial intelligence
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
G
Google Developers Blog
Engineering at Meta
Engineering at Meta
V
V2EX
大猫的无限游戏
大猫的无限游戏
雷峰网
雷峰网
Vercel News
Vercel News
C
Check Point Blog

博客园 - 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直接抛出。