Microsoft.Win32.RegistryKey.GetValueKind C# (CSharp) Méthode

GetValueKind() public méthode

public GetValueKind ( string name ) : Microsoft.Win32.RegistryValueKind
name string
Résultat Microsoft.Win32.RegistryValueKind
        public Microsoft.Win32.RegistryValueKind GetValueKind(string name) { throw null; }
        public string[] GetValueNames() { throw null; }

Usage Example

 private static bool ReadRegistryValue(RegistryKey key, string valueName, bool defaultValue)
 {
     try
     {
         if (key.GetValueKind(valueName) == RegistryValueKind.DWord)
         {
             return Convert.ToBoolean(key.GetValue(valueName), CultureInfo.InvariantCulture);
         }
     }
     catch (UnauthorizedAccessException exception)
     {
         LogRegistryException("ReadRegistryValue", exception);
     }
     catch (IOException exception2)
     {
         LogRegistryException("ReadRegistryValue", exception2);
     }
     catch (SecurityException exception3)
     {
         LogRegistryException("ReadRegistryValue", exception3);
     }
     catch (ObjectDisposedException exception4)
     {
         LogRegistryException("ReadRegistryValue", exception4);
     }
     return defaultValue;
 }
All Usage Examples Of Microsoft.Win32.RegistryKey::GetValueKind