0

I'm using settings in user scope to store the user culture.

My question is:

  • Multiple users using the same machine will share the same user scoped settings, or each user will have their own user settings?

Users use the same windows account and are only distinguished in the login of this application.

Fábio Silva
  • 129
  • 2
  • 14
  • "By the same machine I mean using the same Windows User Account." those are two totally different things. "Same machine" *does not* equal "same user account". Are you saying you have multiple physical human beings logging onto a computer with only one user account which is shared by all the people? And you want different people to have different settings? If that's the case, then there's no way your application will know who's sitting at the keyboard. You'll have to include some way for them to pick their profile, so to speak, when they start using your app. – rory.ap Feb 02 '17 at 15:10
  • "Are you saying you have multiple physical human beings logging onto a computer with only one user account which is shared by all the people?" Yes. "And you want different people to have different settings?" I want to know if they share the same user settings or not. – Fábio Silva Feb 02 '17 at 15:14

1 Answers1

1

If multiple people are logging onto a single machine using a shared user account, by default, they will share the same settings when they use your application unless you program something to make it work otherwise. This is because the application has no way of knowing that a different person is using it. Since it's one user account, the application doesn't know that a different person is sitting behind the keyboard using the application.

If you want to implement the ability for there to be different settings for different people who share one user account, you could introduce some sort of "profile", where each profile contains its own settings. The users would have to select their profile each time they start the application.

EDIT: based on your recent update (involving specific logins to your application): I would suggest that you could modify my approach so that the profile is tied to the login so the user doesn't have to pick the profile.

EDIT: To address your question "is it possible to have a C# setting for each logged in user, or I need to store that info in a DB or in any other way?": That depends on what you mean by "C# setting". If you're talking about the built-in "settings" that are stored in the App.config, then yes by default there is only one. You have a few options: you could write code to dynamically load (at runtime) your own App.config -- one for each user "logged into" your application (see this answer for more info); you could save your settings in your own custom XML file; you could store your settings in a hierarchy in the Windows registry (if you're using Windows); and you could store them in a DB like you suggested. It's up to you.

Community
  • 1
  • 1
rory.ap
  • 34,009
  • 10
  • 83
  • 174
  • "where each profile contains its own settings" But is it possible to have a C# setting for each logged in user, or I need to store that info in a DB or in any other way? – Fábio Silva Feb 02 '17 at 15:22