这篇文章主要介绍了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"))‘注册表子结点
Atas ialah kandungan terperinci 详解vb.net操作注册表【增加,修改,删除,查询】的方法分析. Untuk maklumat lanjut, sila ikut artikel berkaitan lain di laman web China PHP!