Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

c#

path

appdata

1)how can i find out the Windows Installation drive in which the user is working.? I need this to navigate to the ApplicationData in DocumentsandSettings.

2)Also how can i get the user name too so that i can goto ApplicaitionData.? Eg: "D:\Documents and Settings\user\Application Data".

like image 712
SyncMaster Avatar asked May 27 '09 11:05

SyncMaster


1 Answers

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

Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) 
like image 50
Martin Harris Avatar answered Oct 11 '22 13:10

Martin Harris