Reputation: 18993
I want to point a file dialog at a particular folder in the current user's Local Settings folder on Windows. What is the shortcut to get this path?
Upvotes: 23
Views: 34815
Reputation: 73311
string localPath = Directory.GetParent(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)).FullName;
is the simple answer.
Upvotes: 2
Reputation: 77697
Environment.GetFolderPath( Environment.SpecialFolders.LocalApplicationData);?
I can't remember if there is a "Local Settings" folder on Windows XP anymore, it seems vaguely familiar.
Upvotes: 1
Reputation: 3182
How about this, for example:
String appData =
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
I don't see an enum for just the Local Settings folder.
http://web.archive.org/web/20080303235606/http://dotnetjunkies.com/WebLog/nenoloje/archive/2007/07/07/259223.aspx has a list with examples.
Upvotes: 35