扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
作者:符志强 来源:微软社区 2007年11月9日
关键字:
Dim hklm As RegistryKey = Registry.LocalMachine '打开"SYSTEM"子健 Dim software11 As RegistryKey = hklm.OpenSubKey ( "SYSTEM" ,true ) '打开"A000"子健 Dim software As RegistryKey = software11.OpenSubKey ( "A000" , true ) software.DeleteSubKeyTree ( "ddd" ) |
Dim hklm As RegistryKey = Registry.LocalMachine '打开"SYSTEM"子健 Dim software11 As RegistryKey = hklm.OpenSubKey ( "SYSTEM" ,true ) '打开"A000"子健 Dim software As RegistryKey = software11.OpenSubKey ( "A000" , true ) Dim ddd As RegistryKey = software.OpenSubKey ( "ddd" , true ) ddd.DeleteValue( "www" ) |
Private Sub Button1_Click ( ByVal sender As System.Object , ByVal e As System.EventArgs ) _ Handles Button1.Click listBox1.Items.Clear ( ) Dim hklm As RegistryKey = Registry.LocalMachine Dim software11 As RegistryKey = hklm.OpenSubKey ( "SYSTEM" ) '打开"SYSTEM"子健 Dim software As RegistryKey = software11.OpenSubKey ( "A000" ) '打开"A000"子健 Dim KeyCount As integer = software.SubKeyCount '获得当前健下面有多少子健 Dim Str ( ) As String = software.GetSubKeyNames ( ) '获得当前健下面所有子健组成的字符串数组 Dim i As integer For i = 0 to KeyCount - 1 listBox1.Items.Add ( Str ( i ) ) Dim sitekey As RegistryKey = software.OpenSubKey ( Str ( i ) ) '按顺序打开子健 Dim Str2 ( ) As String = sitekey.GetValueNames ( ) '获得当前子健下面所有健组成的字符串数组 Dim ValueCount As integer = sitekey.ValueCount '获得当前子健存在多少健值 Dim j As integer For j = 0 to ValueCount - 1 listBox1.Items.Add ( " " + Str2 ( j ) + ": " + sitekey.GetValue ( Str2 ( j ) ) ) '在列表中加入所有子健、健和健值 Next j Next i End Sub '删除子健 Private Sub Button2_Click ( ByVal sender As System.Object , ByVal e As System.EventArgs ) _ Handles Button2.Click listBox1.Items.Clear ( ) Dim hklm As RegistryKey = Registry.LocalMachine '打开"SYSTEM"子健 Dim software11 As RegistryKey = hklm.OpenSubKey ( "SYSTEM" ,true ) '打开"A000"子健 Dim software As RegistryKey = software11.OpenSubKey ( "A000" , true ) software.DeleteSubKeyTree ( "ddd" ) End Sub '删除指定的健 Private Sub Button3_Click ( ByVal sender As System.Object , ByVal e As System.EventArgs ) _ Handles Button3.Click listBox1.Items.Clear ( ) Dim hklm As RegistryKey = Registry.LocalMachine '打开"SYSTEM"子健 Dim software11 As RegistryKey = hklm.OpenSubKey ( "SYSTEM" ,true ) '打开"A000"子健 Dim software As RegistryKey = software11.OpenSubKey ( "A000" , true ) Dim ddd As RegistryKey = software.OpenSubKey ( "ddd" , true ) ddd.DeleteValue( "www" ) End Sub End Class Module Module1 Sub Main ( ) Application.Run ( New Form1 ( ) ) End Sub End Module |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。