How can i get the path of the current user's "Application Data" folder?

Look at combining Environment.GetFolderPath and Environment.SpecialFolder to do this.

Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)

Depending on what you are doing you might also want to look at

Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)

If the user is on a domain it will only be stored in their local AppData folder and not synced with their roaming profile.


Have a look at the Environment.SpecialFolders

Environment.SpecialFolder.ApplicationData;
Environment.SpecialFolder.System

that should get you round the username requirement as well.

Tags:

C#

Path

Appdata