C# 各种异常解释

今天开发过程中,考虑到用户的使用,就想将代码优化一下添加一些提示什么的,因为用户控制的数据文件实在是太大而且是手动计算填写的,数据在哪里出了错都不知道。就想到了异常处理,查看了.Net库顺便翻译了一下,到不到位的纯属个人理解,方便之后使用。

 

 
异常名称
详细描述
个人理解
A non-null argument that is passed to a method is invalid.
传给函数的非空参数是无效的。
An argument that is passed to a method is null.
传给函数的参数为空。
An argument is outside the range of valid values.
参数超出了有效范围。
Part of a directory path is not valid.
路径无效。
The denominator in an integer or Decimal division operation is zero.
分母为零。
A drive is unavailable or does not exist.
驱动不存在或不可用。
A file does not exist.
文件不存在。
A value is not in an appropriate format to be converted from a string by a conversion method such as Parse.
格式转换异常。
An index is outside the bounds of an array or collection.
索引超出集合范围。
A method call is invalid in an object's current state.
方法调用在对象的当前状态中是无效的。
The specified key for accessing a member in a collection cannot be found.
集合中没有找到该键。
A method or operation is not implemented.
方法或操作还没有实现。
A method or operation is not supported.
不支持该方法或操作。
An operation is performed on an object that has been disposed.
对已经处理的对象执行操作。
An arithmetic, casting, or conversion operation results in an overflow.
算术,转换或转换操作导致的溢出。
A path or file name exceeds the maximum system-defined length.
路径或文件名称超出系统定义的最大长度。
The operation is not supported on the current platform.
在当前平台上不支持的操作。
An array with the wrong number of dimensions is passed to a method.
传递给方法具有错误维数的数组。
The time interval allotted to an operation has expired.
超时。
An invalid Uniform Resource Identifier (URI) is used.
使用无效的统一资源标识符(URI)。

posted on 2018-02-08 17:22  想落地蒲公英  阅读(1036)  评论(0)    收藏  举报

导航