Read from the Windows Registry using C#

By DimitriC at December 08, 2011 09:49
Filed Under: Programming, Windows, tips & tricks

I’ve added an example in the MSDN Samples repository which explains how to read values from the Windows Registry.

 

Description:

 

The example is a simple Console-application that shows you how to select the correct RegistryHive, and afterwards navigate to the correct key and read the value. Keep in mind that reading from the Windows registry always returns an object of type 'object' so you'll need to cast this value to something that makes more sense. This means that you'll be expected to know what you're going to read (integer, binary, string,...). And last but not least, don't forget to add the Microsoft.Win32 using statement!

The available RegistryHives you can read from (and their corresponding names in the Registry Editor (Start => Run => regedit.exe):

  • - ClassesRoot (in RegEdit: HKEY_CLASSES_ROOT)
  • - CurrentConfig (in RegEdit:HKEY_CURRENT_CONFIG)
  • - CurrentUser (in RegEdit:HKEY_CURRENT_USER)
  • - DynData (Windows' own hive with dynamic data. Some configuration information in Windows must be stored in RAM because it requires fast modification and retrieval that cannot wait for the registry to send it to the hard disk. You can find all this data in the HKEY_DYN_DATA registry key. The information in this key is newly created every time Windows starts. Not visible in RegEdit)
  • - LocalMachine (in RegEdit:HKEY_LOCAL_MACHINE)
  • - PerformanceData (Is used to access performance counters but is not visible in Regedit)
  • - Users (in RegEdit:HKEY_USERS)

You can find the example here.

New features announced for Windows Server 2008 R2 and Windows 7 Service Pack 1

By DimitriC at March 19, 2010 14:57
Filed Under: Windows 7, Windows, Technet, Microsoft, Windows Server 2008

TechNet Flash Feed posts:

 

As noted in the Windows Blog, Microsoft today revealed two new desktop virtualization features that will be included in the upcoming Windows Server 2008 R2 Service Pack 1 and an updated Remote Desktop client for Windows 7 SP1.

For Windows Server 2008 R2 SP1, Microsoft announced Dynamic Memory and RemoteFX.

 

Dynamic memory is an enhancement to Hyper-V in R2 and allows IT administrators to pool all the memory available on a physical host and dynamically distribute it to virtual machines running on that host as necessary. Get a deeper look at Dynamic Memory.

 

RemoteFX is the latest addition to Microsoft’s desktop virtualization stack and functions independently of any graphics stack and supports any screen content, including rich content like Silverlight or Flash. RemoteFX works on a wide array of target devices, including both thick and thin client hosts and a wide variety of network configurations. Get more information on RemoteFX here.

 

The Remote Desktop client in Windows 7 SP1 will take advantage of RemoteFX.

[Win 7] expiration dates and functionality

By DimitriC at March 01, 2010 09:46
Filed Under: Windows

Effective March 1, 2010, Windows 7 RC enters the next phase of expiration:

  • Expiration notifications in the task bar continue.
  • Computers that are running Windows 7 RC restart every two hours.
    Important When the computer restarts, your work will not be saved.
Effective June 1, 2010, Windows 7 RC expires:
  • Windows starts to a black desktop.
  • Windows 7 RC users are presented with a Windows Activation screen. The screen states that the Windows that you are running is not genuine.
  • Computers that are running Windows 7 RC restart every two hours.

More information on support.microsoft.com