Home > Backend Development > C#.Net Tutorial > 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

黄舟
Release: 2017-03-27 11:07:13
Original
2130 people have browsed it

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)
Copy after login

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)
Copy after login

Delete:


Dim key As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("Software/Faxturer", True)
key.DeleteSubKey("Manu")
Copy after login

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"))‘注册表子结点
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template