How to

read a windows registry key

Published: 13. December 2008 | Updated: 26. October 2011
License: Microsoft Public License (MS-PL)
Categories: Windows » Registry
Tags: C# Windows Winforms
Was this snippet helpful for you? YESYES / NONO

Import namespace

using Microsoft.Win32;

Code

Size size;
using (RegistryKey key = Registry.LocalMachine.CreateSubKey(@"SOFTWARE\MyApplication"))
{
    size = (Size)key.GetValue("FormSize");
}
Send us feedback about this snippet »



Related Snippets: