Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
1
Reply
How to save username & password locally in .Net application?
Cynthia
May 29 2017 6:31 AM
233
Reply
I am creating a login screen for which i have to save username & password locally so that next time when user login it doesn't ask for login .
I have used this code to save
Configuration config = System.Configuration.ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
config.AppSettings.Settings.Add("UserName"username);
config.AppSettings.Settings.Add("Password ",userpasssword);
config.Save();
System.Configuration.ConfigurationManager.RefreshSection("appSettings");
I am working in debug mode in VS2015 , first the username & password are written to myapp.vshost.exe.config file & once i close application , it is not saved . So, next time when user login ,again it will ask for password .
My question are -:How it will be saved permanently so that it exists even if application is closed so that next time when user login it doesn't ask for login credentials ?
is my approach correct or not ?
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
Disable a button on show of form in mvvm wpf
Resource file are not creating properly