0

I have a windows service whose settings are stored in an ini file in C:\Documents and Settings\All Users\Application Data\company\product and handled by Nini. Now I will write a similar application and look at if I can do a better solution this time. How do you want me to save all program settings. Where should the file be saved? Which tool should I use for handling the file?

The settings should be easily changed by the customer directly in the file. It must be a fix directory.

magol
  • 6,135
  • 17
  • 65
  • 120

1 Answers1

-1

You can use Isolated Storage. Or see for other alternatives

Community
  • 1
  • 1
Kumar
  • 997
  • 5
  • 8
  • If I understand correctly, it's not predefined in wish directory settings are saved in. I have to write in the documentation exact path to the settings file. – magol Mar 10 '11 at 21:07
  • I think you can create an `IsolatedStorageFileStream CreateFile( string path )` else you need see for different approach. – Kumar Mar 10 '11 at 21:09
  • IsolatedStorage is intended for low-privilege software, usually not the case for a Service. And not user editable. – H H Mar 10 '11 at 21:12
  • 1
    As poster said `Now I will write a similar application`, is it going to be a service again or some kind of non service application ? – Kumar Mar 10 '11 at 21:14
  • The location of IsolatedStorage also depends on the particular assembly and changes with each build of the application (thereby becoming "isolated"). The `IsolatedStorageFileStream.CreateFile(string)` method takes a relative path within the isolated foulder. – Jeffrey L Whitledge Mar 10 '11 at 21:17
  • Yeah it takes relative path, just figured it out :) – Kumar Mar 10 '11 at 21:18
  • @Kumar - The new application is a windows service – magol Mar 10 '11 at 21:18
  • Isolated Storage encapsulates the directory from the user - which doesn't meet this requirement: The settings should be easily changed by the customer directly in the file. – dhirschl Mar 10 '11 at 21:32