Microsoft.Win32.Win32RegistryApi.RegDeleteKey C# (CSharp) Méthode

RegDeleteKey() private méthode

private RegDeleteKey ( IntPtr keyHandle, string valueName ) : int
keyHandle System.IntPtr
valueName string
Résultat int
		private static extern int RegDeleteKey (IntPtr keyHandle, string valueName);

Usage Example

        public void DeleteKey(RegistryKey rkey, string keyName, bool shouldThrowWhenKeyMissing)
        {
            IntPtr handle = Win32RegistryApi.GetHandle(rkey);
            int    num    = Win32RegistryApi.RegDeleteKey(handle, keyName);

            if (num != 2)
            {
                if (num != 0)
                {
                    this.GenerateException(num);
                }
                return;
            }
            if (shouldThrowWhenKeyMissing)
            {
                throw new ArgumentException("key " + keyName);
            }
        }