This article mainly introduced the VB.net operation registry method, combined with the example form analysis vb.net to the registry to add, modify, delete and query operation related implementation skills, need friends can refer to the next
The examples in this article describe how vb.net operates the registry. Share to everyone for your reference, as follows:
Increase:
Dim key as Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey ("Software/faxturer", True) Dim subkey as Microsoft.Win32.RegistryKeysubkey = 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)
Modify:
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")
Inquire:
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.RegistryKeysubkey = RK. OpenSubKey ("Manu", False) MsgBox (RK. GetValue ("Path")) ' Registry root node MsgBox (subkey. GetValue ("Path")) ' Registry sub-node