Get registry value from LocalMachine key : Registry : Windows C# Source Code


Custom Search

C# Source Code » Windows » Registry »

 

Get registry value from LocalMachine key








    


using System;
using System.Windows.Forms;
using Microsoft.Win32;

public class FormSettingStore {

    public static void Main(){
        RegistryKey key = Registry.LocalMachine.CreateSubKey("KeyName");

        key.SetValue("Height", "100");
        key.SetValue("Width", "100");
        key.SetValue("Left", "100");
        key.SetValue("Top", "100");

        Console.WriteLine((int)key.GetValue("Height", "150"));
        Console.WriteLine((int)key.GetValue("Width",  "150"));
        Console.WriteLine((int)key.GetValue("Left",  "150"));
        Console.WriteLine((int)key.GetValue("Top",  "150"));
    }
}    
           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Windows
» Registry