Environment.SpecialFolder.ProgramFiles value for a 32-bit application on Windows 7?

本小妞迷上赌 提交于 2019-12-22 08:04:12

问题


What would a 32-bit application running on Windows 7 return for the below?

Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles)

C:\Program Files (x86) or C:\Program Files?


回答1:


On 32 bit Windows 7 you should get "C:\Program Files", on 64 bit "C:\Program Files (x86)".




回答2:


It doesn't matter what it returns. Either value will map to the same folder, file system virtualization will always map it to (x86) for a 32-bit app.




回答3:


Well I'm running Windows 7 Ultimate 32 bit so I wanted to know for sure what was returned, so I put this into a console application to see what was returned

Console.WriteLine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles));

And it returned C:\Program Files




回答4:


C:\Program Files (x86)




回答5:


"C:\Program Files (x86)"



来源:https://stackoverflow.com/questions/3397818/environment-specialfolder-programfiles-value-for-a-32-bit-application-on-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!