Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles)
is probably the best solution, but another possible variant is evaluating the value of the ProgramFiles
environment variable. For this, you can use the GetEnvironmentVariable or ExpandEnvironmentVariables method of the Environment class:
Environment.GetEnvironmentVariable("ProgramFiles")
Environment.ExpandEnvironmentVariables("%ProgramFiles%")