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)。






  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值