NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

RegistryKey.DeleteSubKey

Deletes the specified subkey. To delete child subkeys, use DeleteSubKeyTree. The string subKey is not case sensitive.

[Visual Basic]
Public Sub DeleteSubKey( _
   ByVal subkey As String _
)
[C#]
public void DeleteSubKey(
   string subkey
);
[C++]
public: void DeleteSubKey(
   String* subkey
);
[JScript]
public function DeleteSubKey(
   subkey : String
);

Parameters

subkey
Name of the subkey to delete.

Exceptions

Exception Type Condition
InvalidOperationException thrown if the subkey has child subkeys.
ArgumentNullException thrown if the subkey is null.
SecurityException if the user does not have RegistryPermission.SetInclude(delete, currentKey) access.

Remarks

This function must perform identically in Win95 and NT, so do explicit checking for child subkeys, as this is not illegal in Win95.

See Also

RegistryKey Class | RegistryKey Members | Microsoft.Win32 Namespace