This article mainly introduces the method of operating the registry in vb.net, and analyzes the related implementation skills of vb.net for adding, modifying, deleting and querying the registry in the form of examples. Friends in need can refer to the following
The example in this article describes how vb.net operates the registry. Share it with everyone for your reference, the details are as follows:
Added:
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)
Modified:
Dim key As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("Software/Faxturer", True) reg.SetValue("path", "d:/software/sdf", Microsoft.Win32.RegistryValueKind.String)
Delete:
Dim key As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("Software/Faxturer", True) key.DeleteSubKey("Manu")
Query:
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"))‘注册表子结点
The above is the detailed content of Detailed analysis of methods for operating the registry [add, modify, delete, query] in vb.net. For more information, please follow other related articles on the PHP Chinese website!