I have my users input their User ID and Password in a form after clicking a button on the status bar on the MainWindow of my WPF application. These credentials are then passed to my "servers" Class and into the connection string and it all works perfect. But, let's say for whatever reason, the server stops responding and you have to re-connect but you don't want the user to have to re enter their credentials. How would you go about keeping their credentials they entered during the initial login, into memory during the entire life of the app for recall back into another connection string? I basically want to keep the credentials stored indefinitely and available to any Class in my application...like a Global variable in Visual Basic.
Asked
Active
Viewed 47 times
0
-
I ended up finding the exact answer I needed here: https://stackoverflow.com/questions/12539382/how-to-remember-username-or-password-for-login-form – wlfente Jan 14 '19 at 14:28
-
Possible duplicate of [How to store and retrieve credentials on windows using C#](https://stackoverflow.com/questions/32548714/how-to-store-and-retrieve-credentials-on-windows-using-c-sharp) – Julien Poulin Jan 15 '19 at 00:09
1 Answers
0
You might tru creating a public User class storing the login and password of the connected user. Then you can simply send this User to your reconnect function ?

Keelah
- 192
- 3
- 15