End If
End If
MyBase.Dispose ( disposing )
End Sub
Friend WithEvents Button1 As Button
Friend WithEvents listBox1 As ListBox
Friend WithEvents Button2 As Button
Friend WithEvents Button3 As Button
Private components As System.ComponentModel.Container
'³õʼ»¯³ÌÐòÖÐʹÓõ½µÄ×é¼þ
Private Sub InitializeComponent ( )
Me.listBox1 = New ListBox ( )
Me.Button1 = New Button ( )
Me.Button2 = New Button ( )
Me.Button3 = New Button ( )
Me.SuspendLayout ( )
Me.listBox1.ItemHeight = 12
Me.listBox1.Location = New Point ( 8 , 24 )
Me.listBox1.Name = "listBox1"
Me.listBox1.Size = New Size ( 480 , 292 )
Me.listBox1.TabIndex = 1
...ÏÂÂÔ
Me.Controls.Add ( Me.listBox1 )
Me.Controls.Add ( Me.Button1 )
Me.Controls.Add ( Me.Button2 )
Me.Controls.Add ( Me.Button3 )
Me.Name = "Form1"
Me.Text = "ÓÃVB.NET½øÐÐ×¢²á±í±à³Ì£¡"
Me.ResumeLayout ( False )
End Sub
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 )
Dim ddd As RegistryKey = software.CreateSubKey ( "ddd" )
ddd.SetValue ( "www" , "1234" )
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.CreateSubKey ( "ddd" )
ddd.SetValue ( "www" , "aaaa" )
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 reg01.vb

¡¡¡¡¡¡¡¡¡¡¡¡Í¼03£ºÓÃVB.NET´´½¨ºÍÐÞ¸Ä×¢²á±í³ÌÐòÔËÐнçÃæ




