Sometimes it may require to develop a application which can able to retrive the information from the Registry.
This can be done using the Registry class and RegisteryKey class. Here is a small Application to get a bit knowledge about it.
By using the Registry and RegistryKey classes in Microsoft.Win32, one can easily access the registry.
The following is a sample that reads a key and displays its value:
using System;
using Microsoft.Win32;
class regTest
{
public static void Main(String[] args)
{
RegistryKey regKey;
Object value;
regKey = Registry.LocalMachine;
regKey =
regKey.OpenSubKey("HARDWAREDESCRIPTIONSystemCentralProcessor ");
value = regKey.GetValue("VendorIdentifier");
Console.WriteLine("The central processor of this machine is: {0}.", value);
}
}
No comments:
Post a Comment