How do I get %LocalAppData% in c#?

C#.Net

C# Problem Overview


How do I get %LocalAppData% in C#?

C# Solutions


Solution 1 - C#

If you would like to use an enumeration, try the following:

Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)

Using this technique, you can also find all other Window's file paths (i.e Program Files, My Documents, etc).

Solution 2 - C#

Environment.GetEnvironmentVariable("LocalAppData") for C#, since Visual Studio isn't a language, unless you're looking to get that variable in one of the VS dialogs or something.

Solution 3 - C#

Environment.SpecialFolder.LocalApplicationData

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionDeeView Question on Stackoverflow
Solution 1 - C#Blake BlackwellView Answer on Stackoverflow
Solution 2 - C#Kristopher IvesView Answer on Stackoverflow
Solution 3 - C#David SavageView Answer on Stackoverflow