We want to keep track of which User is logged in at the moment. Instead uf using for example: Environment.Username we want to know the Username from our database. We are able to get the Username from the database but we want to store it somewhere. Any solutions?
Asked
Active
Viewed 768 times
3 Answers
0
An example from the question linked below:
Settings.Default["SomeProperty"] = "Some Value";
Settings.Default.Save(); // Saves settings in application configuration file
I recommend to have a glance at this question.
Best practice to save application settings. There are other solutions as well.

Community
- 1
- 1

Mitulát báti
- 2,086
- 5
- 23
- 37
0
They are several solutions:
Using MVVM, create shared user manager service(recommended).
Singleton service.
Application settings.
Static variable.

HungDL
- 493
- 2
- 11
0
If your application used by more than one user than you can store data in traditional file like, CSV, XML etc. But using such technique you may not get data security, so for that you could use Binary serialization.

Patel Sanni
- 1
- 2