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

推荐订阅源

Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
S
Schneier on Security
A
Arctic Wolf
Scott Helme
Scott Helme
S
Securelist
Schneier on Security
Schneier on Security
W
WeLiveSecurity
Attack and Defense Labs
Attack and Defense Labs
Security Latest
Security Latest
Project Zero
Project Zero
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Know Your Adversary
Know Your Adversary
P
Palo Alto Networks Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Google DeepMind News
Google DeepMind News
P
Proofpoint News Feed
C
Check Point Blog
F
Full Disclosure
Stack Overflow Blog
Stack Overflow Blog
H
Hacker News: Front Page
T
The Blog of Author Tim Ferriss
TaoSecurity Blog
TaoSecurity Blog
Vercel News
Vercel News
A
About on SuperTechFans
N
News and Events Feed by Topic
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
The GitHub Blog
The GitHub Blog
S
Security Affairs
Y
Y Combinator Blog
T
The Exploit Database - CXSecurity.com
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Forbes - Security
Forbes - Security
IT之家
IT之家
WordPress大学
WordPress大学
Last Week in AI
Last Week in AI
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
F
Fortinet All Blogs
N
Netflix TechBlog - Medium
The Register - Security
The Register - Security
Jina AI
Jina AI
云风的 BLOG
云风的 BLOG
T
Tailwind CSS Blog
K
Kaspersky official blog
Hacker News: Ask HN
Hacker News: Ask HN
C
Cisco Blogs
MyScale Blog
MyScale Blog
博客园 - 【当耐特】
T
Threat Research - Cisco Blogs
D
Docker
G
GRAHAM CLULEY

博客园 - pot

在框架中(IFRAME/FRAMESET)传递COOKIE的解决方案[转] jQuery图片播放插件Fancybox使用方法 C#生成缩略图代码 数据抓取的一个类,包含一些常用的方法 抓取AJAX网页的方法-Firefox组件,C#集成 C#编号的ActiveX控件采用CAB的布署方式实例 C#编写ActiveX控件实例(包括命令和事件) PdfAcroViewer C#代码登录活动目录 用XML反序列化快速完成ASP.NET配置文件 - pot - 博客园 android Activity类的使用 Android中的Intent详细讲解 Android模拟器常用使用,和基本功能使用 ZPL II 命令参考 正则表达式语法 - pot - 博客园 C#中接口的作用 The RSA key container could not be opened - pot ASP.NET 页面事件执行顺序 关于object sender,EventArgs e 的一些解释
《C#异常处理》
pot · 2008-04-12 · via 博客园 - pot

1、c#中所有的异常处理都被视为,所有异常都是由System.Exception所派生的。

2、C#中处理错误异常管理的关键字指令有四个:try、catch、throw、finally,有这四个关键字所编写的异常处理功能非常的强大与方便。

3、异常处理的语法:try{有可能产生错误的代码}catch(异常处理声明(声明此catch区段要捕获哪一种类型的异常错误,可以不用声明,这样子便会让catch去捕获任意类型的异常错误)){异常处理程序代码(当catch捕获到异常错误后,所采取对应的程序代码)}注意:利用catch来捕获try-catch中产生的异常错误,可以建立多个catch区段以捕获不同类型的异常错误。

3C#中常见异常类:

说明

OutOfMemoryException

当利用new关键字去初始化分配一块内存失败时

StackOverflowException

当执行程序有利用到堆栈资源时(通常是执行Recursion或太多的循环),将堆栈资源耗尽时

NullReferenceException

当要利用Reference对象时,却是NullReference

TypeInitializationException

若静态对象发生错误,但又缺乏catch区段去处理与对应时

ArrayTypeMismatchException

当存入数据与数组中数据类型不同时

IndexOutOfRangeException

当超过数组的限定范围时

MulticastNotSupportedException

当要合并两个委派对象失败时

ArithmeticException

一般在运算失败时,这包含了DivideByzeroExceptionOverflowException两种异常

DivideByzeroException

当使用除法运算时,分母为0所造成的错误时

OverflowException

当运算后超过数据类型的合法范围时

posted @ 2008-04-12 18:15  pot  阅读(3537)  评论()    收藏  举报