Save user prefs to registry : Registry Save « Windows « C# / CSharp Tutorial






using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

using Microsoft.Win32;

using System.Diagnostics;

public class MainClass{
   public static void Main(){
    RegistryKey regKey = Registry.CurrentUser;
    regKey = regKey.CreateSubKey("Software\\YourSoftwareName\\SubDomain");
    regKey.SetValue("CurrSize", 10);
    regKey.SetValue("CurrColor", "Blue");
   }
}








29.2.Registry Save
29.2.1.Save int value to Registry
29.2.2.Set DateTime value to the Registry
29.2.3.Set String value to the Registry
29.2.4.Save user prefs to registry
29.2.5.delete a key from Registry
29.2.6.Delete a setting in Registry