Home  >  Article  >  Backend Development  >  Detailed analysis of methods for operating the registry [add, modify, delete, query] in vb.net

Detailed analysis of methods for operating the registry [add, modify, delete, query] in vb.net

黄舟
黄舟Original
2017-03-27 11:07:132039browse

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn