ArgumentOutOfRangeException.ActualValue 属性

定义

获取导致此异常的参数值。Gets the argument value that causes this exception.

public:
 virtual property System::Object ^ ActualValue { System::Object ^ get(); };
public virtual object ActualValue { get; }
member this.ActualValue : obj
Public Overridable ReadOnly Property ActualValue As Object

属性值

Object,它包含导致当前 Exception 的参数的值。An Object that contains the value of the parameter that caused the current Exception.

注解

使用此属性可以检索无效参数。Use this property to retrieve the invalid argument.

ActualValue 属性返回传递给构造函数的相同值,或者,如果未提供任何值,则为 nullThe ActualValue property returns the same value that was passed to the constructor, or null if no value was supplied.

在对象构造时为 ActualValue 属性分配一个值。The ActualValue property is assigned a value at the time of object construction. 如果未 nullActualValue 属性值,则会将值的字符串表示形式追加到 Message 属性所包含的消息字符串。If the ActualValue property value is not null, a string representation of the value is appended to the message string held by the Message property.

ActualValue 属性未在 .NET Framework 类库中使用。The ActualValue property is not used within the .NET Framework class library. 它在 .NET Framework 类库引发的所有 ArgumentOutOfRangeException 对象中携带 null 值。It carries a null value in all the ArgumentOutOfRangeException objects thrown by the .NET Framework class library. 提供 ActualValue 属性,使应用程序可以使用可用的参数值。The ActualValue property is provided so that applications can use the available argument value.

此属性是只读的,只应替代以自定义值的内容或格式。This property is read-only and should be overridden only to customize the content or format of the value.

适用于