Saturday, 12 January 2013

Get All Registry Hives VB.NET

Step 1)  Add Namespace  Microsoft.Win32

Step 2) Get All Registry hives using C#
 

Private  Sub Get_RegisTry_hives()
                  String()RegisTry_Hives=Enum.GetNames(Type.GetType(RegisTryHive))
                  Dim regisTryHive As String
                  For Each regisTryHive In RegisTry_Hives
                      Console.WriteLine("Registry Hive:{0}",regisTryHive)
                  Next
End Sub


Output

Registry Hive:ClassesRoot
Registry Hive:CurrentUser
Registry Hive:LocalMachine
Registry Hive:Users
Registry Hive:PerformanceData
Registry Hive:CurrentConfig
Registry Hive:DynData