Alternative user related settings storage for .NET application
My application will be used by many users at once. So that one of the users can get up from his place and another that takes his place will relogin to the program with his account and continue the work. Application has personal settings per u开发者_JAVA百科ser. And the problem is that not every user has his own WINDOWS(active directory) account, so the standard user settings will be same for the users in same windows account. Whats the best alternative to implement strongly typed(serializable) settings like in standard Properties.Settings.Default?
PS for now im considering using database for keeping settings for every user, a small problem here will be serialization. I'll have to store everything in some format(i think it will be binary) and store the type of setting object, so that when i need it in the application-i can properly choose a type for the setting and work with strongly typed one after that..Database is good if your app will be deployed on few machines, in this case database is the most sane way to have centralized storage of user preferences.
If there is only one machine and users connect there via remote desktop or share one physical machine, it's probably better to just load different configuration files based on user login or some other authorization info like that:
AppDomain.CurrentDomain.SetData("APP_CONFIG_FILE", pathToUserConfigFile);
精彩评论