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 ??
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...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With