System.environment API calls for 32 and 64 bit OS

C

codejunkie

I am porting my current project to a 64 bit machine and I am having
some issues with folder paths that vary between a 64 and 32 machine for
any 32 bit application.

The below calls return c:\program files in a 32 bit machine and 64 bit
machine. But i am looking for c:\program files X86 folder in the 64 bit
machine.

How can i implement this in the least number of steps. Can I modify the
below call to specify that i am looking for the 32 bit path?
Thanks in advance.

string commonFiles =
Environment.GetFolderPath(Environment.SpecialFolder.CommonProgramFiles);

string programfiles =
Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top