Creates a new subkey or opens an existing subkey. The string subKey is not case sensitive.
[Visual Basic] Public Function CreateSubKey( _ ByVal subkey As String _ ) As RegistryKey [C#] public RegistryKey CreateSubKey( string subkey ); [C++] public: RegistryKey* CreateSubKey( String* subkey ); [JScript] public function CreateSubKey( subkey : String ) : RegistryKey;
Returns the subkey or null if the operation failed.
Exception Type | Condition |
---|---|
ArgumentNullException | If subkey is null. |
SecurityException | if the user does not have RegistryPermission.SetInclude(create, currentKey) or RegistryPermission.SetInclude(open, currentKey) access. |
The user must have permission at this level and below.
RegistryKey Class | RegistryKey Members | Microsoft.Win32 Namespace