This blog is about the dotnet.all types of codes,news about dotnet including asp.net,vb.net,c# and know about new dotnet technology.programing in asp.net,vb.net,c#, ajax, AJAX tech support for .net and discuss the new technology in dotnet.ncluding asp.net,vb.net,c# and know about new dotnet technology.programing in asp.net,vb.net,c#, ajax, AJAX tech support for .net and discuss the new technology in dotnet.asp.net programming,dot net programming,dotnet programs,dotnet source code,source code.

Free Hosting

Free Hosting

Tuesday, November 11, 2008

Access Registry Using C#(csharp)

Access the registry using C#. Find out the system Information. Using this source code.


/* I used it find Processor Information and Bios Information*/

using System;
using Microsoft.Win32;

class reg {
static void Main() {
RegistryKey? hklm =Registry.LocalMachine;
hklm=hklm.OpenSubKey("HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0");
Object obp=hklm.GetValue("Identifier");
Console.WriteLine("Processor Identifier :{0}",obp);

RegistryKey? hklp =Registry.LocalMachine;
hklp=hklp.OpenSubKey("HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0");
Object obc=hklp.GetValue("VendorIdentifier");
Console.WriteLine("Vendor Identifier :{0}",obc);

RegistryKey? biosv =Registry.LocalMachine;
biosv=biosv.OpenSubKey("HARDWARE\\DESCRIPTION\\System\\MultiFunctionAdapter\\4");
Object obv=biosv.GetValue("Identifier");
Console.WriteLine("Bios Status :{0}",obv);

RegistryKey? biosd =Registry.LocalMachine;
biosd=biosd.OpenSubKey("HARDWARE\\DESCRIPTION\\System\\");
Object obd=biosd.GetValue("SystemBiosDate");
Console.WriteLine("Bios Date :{0}",obd);

RegistryKey? bios =Registry.LocalMachine;
bios=bios.OpenSubKey("HARDWARE\\DESCRIPTION\\System\\");
Object obs=bios.GetValue("Identifier");
Console.WriteLine("System Identifer :{0}",obs);
}
}

0 comments:

dotnet(.Net) Project Source code Downloads and Tutorials

Email Subscrption



Enter your email address:

Delivered by FeedBurner

Feedburner Count

Blog Archive

Unique Visitor

Design by araba-cı | MoneyGenerator Blogger Template by GosuBlogger