views:

122

answers:

2

Can anyone tell me if Environment.SpecialFolders works correctly on non-english versions of windows. for example. where the SpecialFolder.CommonProgramFiles is not "c:\program files\common files"?

+1  A: 

The MSDN page for Environment.SpecialFolders hints at it:

The GetFolderPath method returns the locations associated with this enumeration. The locations of these folders can have different values on different operating systems, the user can change some of the locations, and the locations are localized.

http://msdn.microsoft.com/en-us/library/system.environment.specialfolder.aspx

I haven't seen it first-hand, though.

Kim Gräsman
+3  A: 

Yes - that's the way to go. On a German Windows, the Environment.SpecialFolder.ProgramFiles setting would return C:\Programme, and the Environment.SpecialFolder.CommonProgramFiles would return C:\Programme\Gemeinsame Dateien (or something similar - I always use US-English Windows myself).

Don't hardcode - use the Environment.SpecialFolders!

Marc

marc_s