public static string GetFolderPath (SpecialFolder folder)
{
string dir = null;
if (Environment.IsRunningOnWindows) {
dir = GetWindowsFolderPath ((int) folder);
} else {
dir = InternalGetFolderPath (folder);
}
#if !NET_2_1
if ((dir != null) && (dir.Length > 0) && SecurityManager.SecurityEnabled) {
new FileIOPermission (FileIOPermissionAccess.PathDiscovery, dir).Demand ();
}
#endif
return dir;
}