views:

40

answers:

1

Hi all,

Where should I save an xml file so it can be written to by a service (written in C#) when Windows is logged off?

Thanks Steven

A: 

You could use Isolated Storage, but the most reasonable is Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) since it saves it on the machine in the user profile for whatever account the service is run from.

Albin Sunnanbo
Did you check where LocalApplicationData points to for a Service?
Henk Holterman
Ahh, Local System has no user profile and then most of the special folders goes bananas :-(Then this only works if you start your service from an account with a user profile.
Albin Sunnanbo