Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to store user settings (username, password) in a Windows application for the current logged in user

Tags:

c#

.net

winforms

Now my team is working on a project involving a Windows application (C#).

The application has a option for saving the username and password in the client machine for the current logged in user. The user can start the application without entering username and password. Please check the snapshot of my requirement.

Please suggest a good example or reference.

Alt text http://www.freeimagehosting.net/uploads/0ff58473e0.jpg

like image 249
amexn Avatar asked Apr 21 '10 09:04

amexn


People also ask

How do I store my username and password?

Chrome: Click on the Menu button and then select Settings. Under Settings select Passwords. Under Passwords, select the toggle to turn on Save Passwords.

How do I find my username in C#?

GetCurrent(). Name; Returns: NetworkName\Username. Gets the user's Windows logon name.


1 Answers

To persist user credentials easily and in a secure way you can write them to the application configuration file using the ConfigurationManager class, secure the password using the SecureString class and then encrypt it using tools in the Cryptography namespace.

Edit: This might help: Encrypting Passwords in a .NET app.config File

like image 147
Ucodia Avatar answered Sep 28 '22 06:09

Ucodia