This documentation is archived and is not being maintained.

ParameterInfo.DefaultValue Property

Gets a value indicating the default value if the parameter has a default value.

[Visual Basic]
Public Overridable ReadOnly Property DefaultValue As Object
public virtual object DefaultValue {get;}
public: __property virtual Object* get_DefaultValue();
public function get DefaultValue() : Object;

Property Value

The default value of the parameter, or Value if the parameter has no default value.


The default value is used when an actual value is not specified in the method call. A parameter can have a default value that is a null reference (Nothing in Visual Basic). This is distinct from the case where a default value is not defined.

This method utilizes the DefaultValueImpl method.

To get the ParameterInfo array, first get the method or the constructor and then call MethodBase.GetParameters.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

ParameterInfo Class | ParameterInfo Members | System.Reflection Namespace