I'm writing a C# service that I want to be able to use on Windows and Mono. I've just started experimenting with Mono and am trying to determine the best way to store settings to control the service that works for both Windows and Mono.
Settings file where service is installed
Settings file in platform storage (%APPDATA, /etc, ...)
Small database (SQLite maybe?)
Which do you think is the best, or do you have a better suggestion?
I will also probably be writing a command line client to allow for easier changing of settings, will this change how settings should be stored?
A storage class defines the scope (visibility) and life-time of variables and/or functions within a C Program. They precede the type that they modify. We have four different storage classes in a C program − auto. register.
There are primarily four storage classes in C, viz. automatic, register, static, and external.
In C programming float data type is used to store floating-point values. Float in C is used to store decimal and exponential values. It is used to store decimal numbers (numbers with floating point values) with single precision.
Take a look at IsolatedStorage. This is an API for providing you with per-application storage, it's built into .NET and is supported in Mono. The API provides you with file IO on files that are stored in a location managed by the framework: in Mono it'll be a ~/.isolatedstorage directory, in Windows it'll be somewhere in the user's Documents and Settings.
With this API, you can maintain your settings file without having to worry about operating system specifics or permissions.
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