I am trying to get the path to the currently logged in user’s application data folder.
I’m using
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
But the path that is returned is:
C:\Documents and Settings\Default User\Application Data
I want the logged in user not the Default User.
The path I was expecting was:
C:\Documents and Settings\jbezanson\Application Data
This is the path all the websites I’ve read say I should be getting with that code.
jbezanson is the user I am logged in as.
I am logging into the server via a thin client and terminal services. My application is running on the server. Could this be the problem?
I think the problems should be because the user who is executing the server (and then, your application). The server is probably running using network service or local service accounts and those accounts doesn’t have application data folder.
Hope this helps.