- 9
- 0
- 约 3页
- 2017-08-26 发布于河南
- 举报
=!l一 ==jIⅢ 啦=!Ij.:!巨o=】I
浅谈C#程序中的异常处理机制
唐 瑁
(山东中医药高等专科学校,山东 烟 台264100)
摘 要:程序设计中,异常是一个不可忽略的元素,因此,有效的异常处理是程序完善的重要标志。重点介绍 了C#语言中的
异常处理机制。主要包括异常的基础知识、异常处理机制、程序设计中的异常三个部分。异常基础知识部分,讲解了什么是
异常,异常发生的情况及主要的异常类,使读者对程序异常有基本的认识。异常处理机制部分,从应用程序和理论两方面对
c#语言中对异常的处理机制进行讲解 ,详细分析了三种异常处理语句。程序设计中的异常部分,通过一个简单的程序开发中
的例子扩展异常机制在程序设计中的应用,拓宽软件开发人 员的设计思路。
关键词:程序设计;c#;异常处理
TheMechanismofHandlingExceptioninC# Program
TANG Jun
(SkdndongCollegeoYTradlTibnalChn/eseMed/c)/Te,Yanta,,Skandong26520O,china)
Abstract:In the program designing. an exception istheelementthat is not neglected. so theeffective exception handling isthe important
signwhichmakestheprogram perfect.Thisarticlefocusesonthe exceptionhandlingmechanism onC# language.Itmainly includesthethree
parts,thebasicknowledgeofexception,exceptionhandling mechanism andtheexceptioninprogramming.Inthebasicknowledgepartofexception,
itexplainswhat istheexception.thecondition exception occurredand themain exception class. t『make readerhavethebasicunderstanding of
exception.Inthepartofexceptionhandlingmechanism,itexplainstheexceptionhandling mechanism ofC# from theapplicationandtheoretical
aspects, and analysesthreeexceptionhandling statementindetail. In the part of program designing exception, it expandsexceptionhandling
mechanism inthe program designing application with a simple and developped example application to expand the thinking in the development of
能发生的各类不可预期的情况,比如用户输入错误、内
自身的 存不够、磁盘 出错、网络资源不可用、数据库无法使用
在竞争 等,所有这些错误被称作异常,不能因为这些异常使程
的手工 序运行产生问题。
高 ,但 异常的发生有两种可能:
员提出 (1)代码执行过程 中满足了异常的条件而使程序无法
您可能关注的文档
最近下载
- (教案)会计基础工作规范.docx VIP
- 廉洁的好处与如何做.doc VIP
- 2025至2030中国教育行业发展研究与产业战略规划分析评估报告.docx VIP
- (完整版)BigBrother完整剧情攻略.pdf VIP
- 新常态下企业顶层设计.ppt VIP
- 小学科学新教科版三年级下册全册教案(2026春新版).doc
- 515省道建设工程(427省道改线)环境影响报告书.pdf VIP
- 2020-2021学年江苏省常州市教育学会八年级(上)期末物理试卷含解析.doc VIP
- 2024年内蒙古英语高一上学期模拟试卷与参考答案.docx VIP
- 最新工程建设标准住宅工程质量通病控制标准2022.pdf
原创力文档

文档评论(0)