Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get Application data folder? [duplicate]

Tags:

c#

Possible Duplicate:
How can i get the path of the current user’s “Application Data” folder?
Windows XP Application Data Folder?

I have to save some settings in application data but, when i use something as "@C:\Documents ..." someone can run windous on D:\ So how to get that directory ??

like image 507
mtmtt Avatar asked May 16 '26 01:05

mtmtt


1 Answers

You can use Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); ...

And there's exaple, how you can use it:

string path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);

and it returns something like C:\\Users\\UserName\\ApplicationData

and you can use Environment.SpecialFolder.Desktop too so you can get to desktop of actual user...

like image 196
GemHunter1 Avatar answered May 18 '26 15:05

GemHunter1