Writing to registry in a C# application
问题 I'm trying to write to the registry using my C# app. I'm using the answer given here: Writing values to the registry with C# However for some reason the key isn't added to the registry. I'm using the following code: string Timestamp = DateTime.Now.ToString("dd-MM-yyyy"); string key = "HKEY_LOCAL_MACHINE\\SOFTWARE\\"+Application.ProductName+"\\"+Application.ProductVersion; string valueName = "Trial Period"; Microsoft.Win32.Registry.SetValue(key, valueName, Timestamp, Microsoft.Win32