IT Community - Software Programming, Web Development and Technical Support

How can I access the registry from C# code DOT NET 2005?

This is a discussion on How can I access the registry from C# code DOT NET 2005? within the C# Programming forums, part of the Software Development category; How can I access the registry from C# code DOT NET 2005?...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > C# Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 07-25-2007, 03:12 AM
Archer Archer is offline
D-Web Programmer
 
Join Date: Jun 2007
Posts: 52
Archer is on a distinguished road
Question How can I access the registry from C# code DOT NET 2005?

How can I access the registry from C# code DOT NET 2005?
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-25-2007, 03:20 AM
kingmaker kingmaker is offline
D-Web Genius
 
Join Date: Jun 2007
Posts: 882
kingmaker is on a distinguished road
Send a message via Yahoo to kingmaker
Default Re: How can I access the registry from C# code DOT NET 2005?

By using the Registry and RegistryKey classes in Microsoft.Win32, you 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("HARDWAREDESCRIPTIONSystemCentr alProcessor ");
value = regKey.GetValue("VendorIdentifier");
Console.WriteLine("The central processor of this machine is: {0}.", value);
}
}
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is Windows Registry? arjkhanna Operating Systems 7 02-18-2008 11:10 AM
Practical issues when we develop code in Windows Forms in C#.Net 2005 Sathish Kumar C# Programming 10 09-20-2007 07:17 AM
How to read and write System Registry Keys using C# (VS.Net 2005) oxygen C# Programming 2 08-31-2007 11:41 PM
I Cannot access SQL 2005 integrated services after installing SQL-2005..? theone Database Support 1 07-27-2007 01:12 AM
Access e-mail using Outlook Web Access gattuso Server Management 0 07-19-2007 07:20 AM


All times are GMT -7. The time now is 11:09 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0