Overview | Methods | This Package | All Packages
Retrieves the specified subkey.
Syntax
public RegistryKey getSubKey( String name )
public RegistryKey getSubKey( String name, boolean readonly )
Parameters
name
The name and/or path of the subkey to open.
readonly
Set to true to provide read-only access to the specified subkey; set to false for read/write access. If this value is not specified, the key defaults to read-only access.
Return Value
Returns a RegistryKey object that represents the requested subkey, or returns null if the operation fails.
Remarks
Use the getSubKey method to open an existing subkey and assign it to a RegistryKey object. If the key does not exist, a null value is returned. To open an existing key or to create a key, use the createSubKey method. To read information from the specified registry key, use the second version of this method, and set the readonly parameter to true to open the registry key for read-only access. If you do not know the name of the subkey, use the getSubKeyNames method to return all the subkeys for a specified key.
See Also getSubKeyCount, getSubKeyNames