I have weird problem.
I`m using windows 7 enterprise sp1 64 bit.
I need to take Program files and Program files X86 directories path for my project. This is what I’ve done:
Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);
Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86);
but both of these lines returns Program files X86 folder.
How can I resolve it?
The result depends on what platform is your project targeting. If you target x86, then both
Environment.SpecialFolder.ProgramFilesandEnvironment.SpecialFolder.ProgramFilesX86will return the same path.For example to get the actual path as a
stringuse