VB.NET写注册表

Posted on 2005-07-10 12:28  flourish  阅读(169)  评论(0)    收藏  举报
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

博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3