Partager via


RegistrationAttribute.Key.SetValue(String, Object) Method

Definition

Sets the name to the given value.

public:
 abstract void SetValue(System::String ^ valueName, System::Object ^ value);
public:
 abstract void SetValue(Platform::String ^ valueName, Platform::Object ^ value);
 abstract void SetValue(std::wstring const & valueName, winrt::Windows::Foundation::IInspectable const & value);
public abstract void SetValue (string valueName, object value);
abstract member SetValue : string * obj -> unit
Public MustOverride Sub SetValue (valueName As String, value As Object)

Parameters

valueName
String

The name of the value to set. If valueName is null or an empty string, SetValue sets the default value for the current Key.

value
Object

An object to store in the value. Use an empty string or null to set the default value for a key. If the object is a numeric type that can be converted to an integer, it is stored as a DWORD registry encoding. Otherwise it is stored as a string.

Remarks

This method is typically called from within the Register method of a class derived from RegistrationAttribute.

Applies to