tabs ↹ over ␣ ␣ ␣ spaces

by Jiří {x2} Činčura

Looking for user application data path

17 Jun 2006 1 mins .NET, Windows

Today I was looking for user application data path (Application.UserAppDataPath) but without creating the BasePath\CompanyName\ProductName\ProductVersion structure. I was really confused with this, but suddenly I found the solution. (ok, you’re right, I should use google prior to surfing in documentation 😃) The Environment.SpecialFolder enumeration and Environment.GetFolderPath – it’s so easy.

So the result is:

Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)

or maybe better for you:

Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)+Path.DirectorySeparatorChar

Profile Picture Jiří Činčura is .NET, C# and Firebird expert. He focuses on data and business layers, language constructs, parallelism, databases and performance. For almost two decades he contributes to open-source, i.e. FirebirdClient. He works as a senior software engineer for Microsoft. Frequent speaker and blogger at www.tabsoverspaces.com.