C# Class Microsoft.Win32.RegistryKey

Inheritance: System.MarshalByRefObject, IDisposable
Show file Open project: dotnet/corefx Class Usage Examples

Private Properties

Property Type Description
ClosePerfDataKey void
CreateSubKeyInternalCore RegistryKey
DeleteSubKeyCore void
DeleteSubKeyTreeCore void
DeleteValueCore void
FlushCore void
FromHandle Microsoft.Win32.RegistryKey
FromHandle Microsoft.Win32.RegistryKey
GetValueKindCore RegistryValueKind
GetValueNamesCore string[]
InternalGetSubKeyNamesCore string[]
InternalGetValueCore object
InternalOpenSubKeyCore RegistryKey
InternalSubKeyCountCore int
InternalValueCountCore int
IsWritable bool
OpenBaseKeyCore RegistryKey
OpenRemoteBaseKeyCore RegistryKey
RegistryKey
SetValueCore void
Win32Error void
Win32ErrorStatic void

Public Methods

Method Description
CreateSubKey ( string subkey ) : Microsoft.Win32.RegistryKey
CreateSubKey ( string subkey, bool writable ) : Microsoft.Win32.RegistryKey
CreateSubKey ( string subkey, bool writable, Microsoft options ) : Microsoft.Win32.RegistryKey
DeleteSubKey ( string subkey ) : void
DeleteSubKey ( string subkey, bool throwOnMissingSubKey ) : void
DeleteSubKeyTree ( string subkey ) : void
DeleteSubKeyTree ( string subkey, bool throwOnMissingSubKey ) : void
DeleteValue ( string name ) : void
DeleteValue ( string name, bool throwOnMissingValue ) : void
Dispose ( ) : void
Flush ( ) : void
GetSubKeyNames ( ) : string[]
GetValue ( string name ) : object
GetValue ( string name, object defaultValue ) : object
GetValue ( string name, object defaultValue, Microsoft options ) : object
GetValueKind ( string name ) : Microsoft.Win32.RegistryValueKind
GetValueNames ( ) : string[]
OpenBaseKey ( Microsoft hKey, Microsoft view ) : Microsoft.Win32.RegistryKey
OpenSubKey ( string name ) : Microsoft.Win32.RegistryKey
OpenSubKey ( string name, System rights ) : Microsoft.Win32.RegistryKey
OpenSubKey ( string name, bool writable ) : Microsoft.Win32.RegistryKey
SetValue ( string name, object value ) : void
SetValue ( string name, object value, Microsoft valueKind ) : void
ToString ( ) : string

Private Methods

Method Description
ClosePerfDataKey ( ) : void
CreateSubKeyInternalCore ( string subkey, bool writable, RegistryOptions registryOptions ) : RegistryKey
DeleteSubKeyCore ( string subkey, bool throwOnMissingSubKey ) : void
DeleteSubKeyTreeCore ( string subkey ) : void
DeleteValueCore ( string name, bool throwOnMissingValue ) : void
FlushCore ( ) : void
FromHandle ( Microsoft handle ) : Microsoft.Win32.RegistryKey
FromHandle ( Microsoft handle, Microsoft view ) : Microsoft.Win32.RegistryKey
GetValueKindCore ( string name ) : RegistryValueKind
GetValueNamesCore ( int values ) : string[]

Retrieves an array of strings containing all the value names.

InternalGetSubKeyNamesCore ( int subkeys ) : string[]
InternalGetValueCore ( string name, object defaultValue, bool doNotExpand ) : object
InternalOpenSubKeyCore ( string name, RegistryRights rights, bool throwOnPermissionFailure ) : RegistryKey
InternalSubKeyCountCore ( ) : int
InternalValueCountCore ( ) : int
IsWritable ( int rights ) : bool
OpenBaseKeyCore ( RegistryHive hKeyHive, RegistryView view ) : RegistryKey

Retrieves a new RegistryKey that represents the requested key. Valid values are: HKEY_CLASSES_ROOT, HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE, HKEY_USERS, HKEY_PERFORMANCE_DATA, HKEY_CURRENT_CONFIG.

OpenRemoteBaseKeyCore ( RegistryHive hKey, string machineName, RegistryView view ) : RegistryKey
RegistryKey ( )
SetValueCore ( string name, object value, RegistryValueKind valueKind ) : void
Win32Error ( int errorCode, string str ) : void

After calling GetLastWin32Error(), it clears the last error field, so you must save the HResult and pass it to this method. This method will determine the appropriate exception to throw dependent on your error, and depending on the error, insert a string into the message gotten from the ResourceManager.

Win32ErrorStatic ( int errorCode, string str ) : void

Method Details

CreateSubKey() public method

public CreateSubKey ( string subkey ) : Microsoft.Win32.RegistryKey
subkey string
return Microsoft.Win32.RegistryKey

CreateSubKey() public method

public CreateSubKey ( string subkey, bool writable ) : Microsoft.Win32.RegistryKey
subkey string
writable bool
return Microsoft.Win32.RegistryKey

CreateSubKey() public method

public CreateSubKey ( string subkey, bool writable, Microsoft options ) : Microsoft.Win32.RegistryKey
subkey string
writable bool
options Microsoft
return Microsoft.Win32.RegistryKey

DeleteSubKey() public method

public DeleteSubKey ( string subkey ) : void
subkey string
return void

DeleteSubKey() public method

public DeleteSubKey ( string subkey, bool throwOnMissingSubKey ) : void
subkey string
throwOnMissingSubKey bool
return void

DeleteSubKeyTree() public method

public DeleteSubKeyTree ( string subkey ) : void
subkey string
return void

DeleteSubKeyTree() public method

public DeleteSubKeyTree ( string subkey, bool throwOnMissingSubKey ) : void
subkey string
throwOnMissingSubKey bool
return void

DeleteValue() public method

public DeleteValue ( string name ) : void
name string
return void

DeleteValue() public method

public DeleteValue ( string name, bool throwOnMissingValue ) : void
name string
throwOnMissingValue bool
return void

Dispose() public method

public Dispose ( ) : void
return void

Flush() public method

public Flush ( ) : void
return void

GetSubKeyNames() public method

public GetSubKeyNames ( ) : string[]
return string[]

GetValue() public method

public GetValue ( string name ) : object
name string
return object

GetValue() public method

public GetValue ( string name, object defaultValue ) : object
name string
defaultValue object
return object

GetValue() public method

public GetValue ( string name, object defaultValue, Microsoft options ) : object
name string
defaultValue object
options Microsoft
return object

GetValueKind() public method

public GetValueKind ( string name ) : Microsoft.Win32.RegistryValueKind
name string
return Microsoft.Win32.RegistryValueKind

GetValueNames() public method

public GetValueNames ( ) : string[]
return string[]

OpenBaseKey() public static method

public static OpenBaseKey ( Microsoft hKey, Microsoft view ) : Microsoft.Win32.RegistryKey
hKey Microsoft
view Microsoft
return Microsoft.Win32.RegistryKey

OpenSubKey() public method

public OpenSubKey ( string name ) : Microsoft.Win32.RegistryKey
name string
return Microsoft.Win32.RegistryKey

OpenSubKey() public method

public OpenSubKey ( string name, System rights ) : Microsoft.Win32.RegistryKey
name string
rights System
return Microsoft.Win32.RegistryKey

OpenSubKey() public method

public OpenSubKey ( string name, bool writable ) : Microsoft.Win32.RegistryKey
name string
writable bool
return Microsoft.Win32.RegistryKey

SetValue() public method

public SetValue ( string name, object value ) : void
name string
value object
return void

SetValue() public method

public SetValue ( string name, object value, Microsoft valueKind ) : void
name string
value object
valueKind Microsoft
return void

ToString() public method

public ToString ( ) : string
return string