Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> C#

Base Class สำหรับ Exceptions ทั้งหมดใน C#

System.SystemException เป็น Base Class สำหรับ Predefined System Exceptions คลาสที่สืบทอดจาก System.Exception ได้แก่ System.ApplicationException และ System.SystemException

System.ApplicationException รองรับ Exceptions ที่โปรแกรมเมอร์สร้างเอง ควรสืบทอดจากคลาสนี้

Exceptions ภายใต้ System.SystemException

ลำดับException Class และ คำอธิบาย
1System.IO.IOException - I/O Errors
2System.IndexOutOfRangeException - Array Index Out of Range
3System.ArrayTypeMismatchException - Type Mismatch กับ Array
4System.NullReferenceException - Reference Null Object
5System.DivideByZeroException - Divide by Zero
6System.InvalidCastException - Typecasting Error
7System.OutOfMemoryException - Insufficient Memory
8System.StackOverflowException - Stack Overflow