本文整理汇总了VB.NET中Microsoft.Win32.RegistryKey.DeleteSubKey方法的典型用法代码示例。如果您正苦于以下问题:VB.NET RegistryKey.DeleteSubKey方法的具体用法?VB.NET RegistryKey.DeleteSubKey怎么用?VB.NET RegistryKey.DeleteSubKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Win32.RegistryKey
的用法示例。
在下文中一共展示了RegistryKey.DeleteSubKey方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: RegKeyDel
' 导入命名空间
Imports Microsoft.Win32
Public Class RegKeyDel
Public Shared Sub Main()
' Create a subkey named Test9999 under HKEY_CURRENT_USER.
Dim test9999 As RegistryKey = _
Registry.CurrentUser.CreateSubKey("Test9999")
' Create two subkeys under HKEY_CURRENT_USER\Test9999. The
' keys are disposed when execution exits the using statement.
Dim testName As RegistryKey = test9999.CreateSubKey("TestName")
Dim testSettings As RegistryKey = test9999.CreateSubKey("TestSettings")
' Create data for the TestSettings subkey.
testSettings.SetValue("Language", "French")
testSettings.SetValue("Level", "Intermediate")
testSettings.SetValue("ID", 123)
' delete the subkey "TestName"
test9999.DeleteSubKey("TestName")
' delete everything under and including "Test9999"
Registry.CurrentUser.DeleteSubKeyTree("Test9999")
End Sub
End Class