using System; using Microsoft.Win32; class MainClass { public static void Main(String[] args) { int Count = (Int32)Registry.GetValue( @"HKEY_CURRENT_USER\Software\CompanyName\SoftwareName", "Count", 0); // 0 is the default value } }