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

推荐订阅源

T
The Blog of Author Tim Ferriss
Know Your Adversary
Know Your Adversary
P
Palo Alto Networks Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
K
Kaspersky official blog
L
LINUX DO - 热门话题
P
Proofpoint News Feed
P
Privacy & Cybersecurity Law Blog
Google DeepMind News
Google DeepMind News
Attack and Defense Labs
Attack and Defense Labs
Cisco Talos Blog
Cisco Talos Blog
AI
AI
L
LINUX DO - 最新话题
H
Heimdal Security Blog
Hacker News: Ask HN
Hacker News: Ask HN
Webroot Blog
Webroot Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
The GitHub Blog
The GitHub Blog
I
Intezer
Blog — PlanetScale
Blog — PlanetScale
有赞技术团队
有赞技术团队
S
Securelist
博客园_首页
IT之家
IT之家
Schneier on Security
Schneier on Security
博客园 - 叶小钗
罗磊的独立博客
WordPress大学
WordPress大学
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
MongoDB | Blog
MongoDB | Blog
P
Proofpoint News Feed
阮一峰的网络日志
阮一峰的网络日志
A
Arctic Wolf
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
W
WeLiveSecurity
The Register - Security
The Register - Security
D
DataBreaches.Net
S
Security @ Cisco Blogs
Security Archives - TechRepublic
Security Archives - TechRepublic
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
腾讯CDC
Recorded Future
Recorded Future
NISL@THU
NISL@THU
N
News and Events Feed by Topic
T
Tailwind CSS Blog
N
News and Events Feed by Topic
Cyberwarzone
Cyberwarzone
T
Tor Project blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com

博客园 - chance_win

感觉日子变苦了 工作了,就不要在象个孩子 成长的点滴 跨平台和可移植的区别 人生的又一个转折 每个人都应该是善良的 终于得了特等奖 aip团队开通--一个值得纪念的日子 学习敏捷开发 第一次见客户 第一次见客户--尴尬的一天 《C#程序员参考手册》 《effictive java》 《敏捷软件开发-原则、模式与实践》 《OOD启示录》 《JAVA与模式》 说给我的学生们 读《.NET本质论》样章有感 .NET程序员们都在干什么?
关于.NET下异常的问题
chance_win · 2005-05-27 · via 博客园 - chance_win

刚才在书上看到了一个介绍异常的代码,程序如下:

 1using System;
 2using System.IO;
 3
 4public class ExceptionDemo
 5{
 6 public static void Main()
 7 {
 8  StreamWriter sw = null;
 9
10  try
11  {
12   sw = new StreamWriter(new FileStream("Area.txt",FileMode.Open));
13   sw.WriteLine("Hello there");
14  }

15  catch(FileNotFoundException fnfe)
16  {
17   Console.WriteLine("djslfjdsfj");
18  }

19  catch(Exception e)
20  {
21   Console.Write(e);
22  }

23  finally
24  {
25   if(sw != null)
26   {
27    sw.Close();
28   }

29  }

30 }

31}

32

有一个问题想问问,在书上说可以不在catch后的括号内指定异常类型和变量名,如果不指定就意味着使用所有异常类的基类,也就是Exception类,但是我将第19行catch括号中的类型名和变量名去掉后,编译不过,这是为什么呢?希望得到大家的帮助。谢谢