Microsoft.Win32.KeyHandler.SetValue C# (CSharp) Méthode

SetValue() public méthode

public SetValue ( string name, object value ) : void
name string
value object
Résultat void
		public void SetValue (string name, object value)
		{
			AssertNotMarkedForDeletion ();

			if (name == null)
				name = string.Empty;

			// immediately convert non-native registry values to string to avoid
			// returning it unmodified in calls to UnixRegistryApi.GetValue
			if (value is int || value is string || value is byte[] || value is string[])
				values[name] = value;
			else
				values[name] = value.ToString ();
			SetDirty ();
		}

Same methods

KeyHandler::SetValue ( string name, object value, RegistryValueKind valueKind ) : void

Usage Example

        public void SetValue(RegistryKey rkey, string name, object value, RegistryValueKind valueKind)
        {
            KeyHandler keyHandler = KeyHandler.Lookup(rkey, true);

            if (keyHandler == null)
            {
                throw RegistryKey.CreateMarkedForDeletionException();
            }
            keyHandler.SetValue(name, value, valueKind);
        }
All Usage Examples Of Microsoft.Win32.KeyHandler::SetValue