本文整理匯總了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