using System; using Microsoft.Win32; class MainClass { public static void Main(String[] args) { Registry.SetValue( @"HKEY_CURRENT_USER\Software\CompanyName\SoftwareName", "User", Environment.UserName, RegistryValueKind.String); } }