Imports System
- Imports Microsoft.Win32
- Imports Microsoft.VisualBasic
-
- Public Class Example
- Public Shared Sub Main()
-
- Registry.CurrentUser.DeleteSubKey("RegistryOpenSubKeyExample", False)
- Dim rk As RegistryKey = Registry.CurrentUser.CreateSubKey("RegistryOpenSubKeyExample")
- rk.Close
-
-
-
- Dim rkCurrentUser As RegistryKey = Registry.CurrentUser
-
-
- Dim rkTest As RegistryKey = rkCurrentUser.OpenSubKey("RegistryOpenSubKeyExample")
- Console.WriteLine("Test key: {0}", rkTest)
- rkTest.Close
- rkCurrentUser.Close
-
-
-
- rkTest = Registry.CurrentUser.OpenSubKey("RegistryOpenSubKeyExample")
- Console.WriteLine("Test key: {0}", rkTest)
- rkTest.Close
-
-
- rkTest = Registry.CurrentUser.OpenSubKey("RegistryOpenSubKeyExample", True)
- rkTest.SetValue("TestName", "TestValue")
- Console.WriteLine("Test value for TestName: {0}", rkTest.GetValue("TestName"))
- rkTest.Close
- End Sub
- End Class
|