Quote:The function below will return the x86 Program Files directory in all of these three Windows configurations: 32 bit Windows 32 bit program running on 64 bit Windows 64 bit program running on 64 bit windows C# static string ProgramFilesx86() { if( 8 == IntPtr.Size || (!String.IsNullOrEmpty(Environment.GetEnvironmentVariable("PROCESSOR_ARCHITEW6432")))) { return Environment.GetEnvironmentVariable("ProgramFiles(x86)"); } return Environment.GetEnvironmentVariable("ProgramFiles"); }
static string ProgramFilesx86() { if( 8 == IntPtr.Size || (!String.IsNullOrEmpty(Environment.GetEnvironmentVariable("PROCESSOR_ARCHITEW6432")))) { return Environment.GetEnvironmentVariable("ProgramFiles(x86)"); } return Environment.GetEnvironmentVariable("ProgramFiles"); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)