vb.net操作注冊表的方法分析【增加,修改,刪除,查詢】。本站提示廣大學習愛好者:(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程序設計有所幫助。