'´ò¿ª"SYSTEM"×Ó½¡
Dim software11 As RegistryKey = hklm.OpenSubKey ( "SYSTEM" ,true )
'´ò¿ª"A000"×Ó½¡
Dim software As RegistryKey = software11.OpenSubKey ( "A000" , true )
software.DeleteSubKeyTree ( "ddd" )
¡¡¡¡£¨3£©. DeleteValue ( )·½·¨£º
¡¡¡¡´Ë·½·¨ÊÇɾ³ýÖ¸¶¨µÄ½¡Öµ¡£ÔÚ³ÌÐòÖе÷Óô˷½·¨µÄÔÐÍΪ£º
¡¡¡¡DeleteValue ( string value )£ºÆäÖÐ"value"¾ÍÊÇҪɾ³ýµÄ½¡ÖµµÄÃû³Æ¡£
¡¡¡¡ÏÂÃæÕâÒ»¶Î´úÂëµÄ×÷ÓþÍÊÇɾ³ý×Ó½¡"ddd"ÖеĽ¡"www"£º
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" )
¡¡¡¡Æß£®VB.NETɾ³ý×¢²á±íÐÅÏ¢³ÌÐò´úÂ루reg02.vb£©£º
¡¡¡¡Í¨¹ýÉÏÃæµÄÄǸöÀý×Ó£¬½áºÏÒÔÉϵÄ֪ʶ£¬ÎÒÃÇ¿ÉÒԵõ½ÓÃÀ´É¾³ýÓÐreg01.vbËù´´½¨µÄ×¢²á±íÐÅÏ¢µÄ³ÌÐò´úÂ루reg02.vb£©£¬´úÂëÈçÏ£º
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
¡¡¾¹ýÈçÏÂÃüÁî±àÒëºó£¬¿ÉÒԵõ½ÈçÏÂÔËÐнçÃæ£º
¡¡vbc /r:system.dll /r:system.windows.forms.dll
/r:system.drawing.dll reg02.vb

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Í¼04£ºÓÃVB.NETɾ³ý×¢²á±í³ÌÐòÔËÐнçÃæ
¡¡¡¡°Ë£º×ܽ᣺
¡¡¡¡ÖÁ´ËÎÒÃÇÒѾ±È½ÏÈ«ÃæµÄ½éÉÜÁËÓÃVB.NET½øÐÐÓë×¢²á±íÏà¹ØµÄ¸÷ÖÖ±à³Ì£¬ÆäÖаüÀ¨ÈçºÎÀûÓÃVB.NETÀ´¶Áȡע²á±í£¬ÈçºÎ´´½¨×¢²áÐÅÏ¢£¬ÈçºÎÐÞ¸Ä×¢²áÐÅÏ¢£¬ÈçºÎɾ³ý¡¢ÖØÃüÃû×¢²áÐÅÏ¢µÈ¡£×îºó»¹ÒªÌáÐÑһϣ¬ÓÉÓÚ×¢²á±íÊÇÊÓ´°µÄºËÐÄÊý¾Ý¿â£¬ËùÒÔÔÚ³ÌÐòÖÐÿһ´Î¶ÔÓë×¢²á±íÏà¹ØµÄ²Ù×÷¶¼Ó¦¸Ã·Ç³£×¢Ò⣬×öºÃ±¸·Ý¹¤×÷£¬ÃâµÃÒ»´ÎÎó²Ù×÷µ¼ÖÂϵͳµÄ±ÀÀ£¡£
ÎÄÕÂÕûÀí£ºÎ÷²¿ÊýÂë--רҵÌṩÓòÃû×¢²á¡¢ÐéÄâÖ÷»ú·þÎñ
http://www.west263.com
ÒÔÉÏÐÅÏ¢ÓëÎÄÕÂÕýÎÄÊDz»¿É·Ö¸îµÄÒ»²¿·Ö,Èç¹ûÄúÒª×ªÔØ±¾ÎÄÕÂ,Çë±£ÁôÒÔÉÏÐÅÏ¢£¬Ð»Ð»!




