[VB.NET]用VB.NET来访问和修改注册表??

来源:互联网 发布:网络机顶盒推荐 编辑:程序博客网 时间:2024/03/29 18:45
VB.NET源码-156个实用实例哦……<script type="text/javascript"><!--google_ad_client = "pub-8333940862668978";/* 728x90, 创建于 08-11-30 */google_ad_slot = "4485230109";google_ad_width = 728;google_ad_height = 90;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
用VB.NET来访问和修改注册表??
我想用VB.NET来访问和修改注册表??有那位大哥能帮小弟!!!小弟是位初学者!!
对编程特感兴趣!!!
__________________________________________________________________________
Imports Microsoft.Win32

Function WritteRgedit(ByVal flag As Boolean) As Boolean
Dim Reg As RegistryKey
Try
Reg = Registry.LocalMachine.CreateSubKey( software/Microsoft/windows update )
Reg.CreateSubKey( condition )
If flag = True Then
Reg.SetValue( condition , 1 )
Else
Reg.SetValue( condition , 0 )
End If
Return True
Catch ex As Exception
Return False
End Try
End Function
__________________________________________________________________________
我不知道怎样调用这个函数!!!
能不能详细一点!!!
我的水太低了!!!!!
__________________________________________________________________________
MSDN
__________________________________________________________________________
哎呀 楼主

赶快 用 vb 2005

你只要 点击 鼠标右键 就可以插入 注册表读写 的代码
__________________________________________________________________________
必需先声明 Imports Microsoft.Win32

Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
Dim reg As RegistryKey
reg = Registry.CurrentUser
reg = reg.OpenSubKey( Software/Microsoft/Internet Explorer/Main , True)
Me.TextBox1.Text = reg.GetValue( Window Title )
End Sub
读取注册表的值

修改注册表的值
Private Sub Button2_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button2.Click
Dim reg As RegistryKey
reg = Registry.CurrentUser
reg = reg.OpenSubKey( Software/Microsoft/Internet Explorer/Main , True)
reg.SetValue( Window Title , Me.TextBox1.Text)
End Sub
__________________________________________________________________________
up...
__________________________________________________________________________
原创粉丝点击