這篇文章主要介紹了vb.net操作註冊表的方法,結合實例形式分析了vb.net針對註冊表的增加,修改,刪除及查詢操作相關實現技巧,需要的朋友可以參考下
本文實例講述了vb.net操作註冊表的方法。分享給大家參考,具體如下:
增加:
Dim key As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("Software/Faxturer", True) Dim subkey As Microsoft.Win32.RegistryKey subkey = key.CreateSubKey("Manu") subkey.SetValue("Path", "d:/software/sdf", Microsoft.Win32.RegistryValueKind.String) 'reg.SetValue("path", New String() {"d:/software/sdf","dfdf"}, Microsoft.Win32.RegistryValueKind.MultiString)
修改:
##
Dim key As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("Software/Faxturer", True) reg.SetValue("path", "d:/software/sdf", Microsoft.Win32.RegistryValueKind.String)
Dim key As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("Software/Faxturer", True) key.DeleteSubKey("Manu")
#
Dim rk As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("Software/ManuFaxturer", True) Dim s As String() = rk.GetSubKeyNames() Dim subkey As Microsoft.Win32.RegistryKey subkey = rk.OpenSubKey("Manu", False) MsgBox(rk.GetValue("Path"))'注册表根节点 MsgBox(subkey.GetValue("Path"))‘注册表子结点
以上是詳解vb.net操作註冊表【增加,修改,刪除,查詢】的方法分析的詳細內容。更多資訊請關注PHP中文網其他相關文章!