本帖最后由 沈可 于 2014-1-16 18:23 编辑
//System
ArgumentNullException //参数异常
ArgumentOutOfRangeException //参数异常
DivideByZeroException //除数为0异常
IndexOutOfRangeException //索引超出范围的异常
NullReference-Exception//参数异常
OverflowException //溢出异常
StackOverflowException //堆溢出异常
-----------------------------------------------
//System.IO
DirectoryNotFoundException//找不到路径的异常
EndOfStreamException //结束流的异常
FileNotFoundException//找不到文件异常
PathToo-LongException //路径太长异常
----------------------------------------------------
//System.Data
DuplicateNameException
InvalidConstrainException
InvalidExpressionException
Missing-PrimaryKeyException
NoNullAllowed-Exception
ReadOnlyException
-----------------------------------
//System.Runtime.InteropServices
InvalidComObjectException
InvalidOleVariantTypeException
SEHException
可以通过
try{}
catch(exception )
{
messagebox.show(ex.message);//抛出异常
}
|