TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Korathu Alexander
1.4k
349
37k
Windows Credential Manager with c#
May 18 2018 3:10 AM
I am saving the credentails to the windows vault store using the credential manager API . But i need to keep it secure and also what is the maximum password limit length to do so.
Core Code to save and retrieve the credentails in the windows vault folder as below:
//save password to the windows vault store using Credential Manager
public
void
SavePassword(
string
password)
{
try
{
using
(var cred =
new
Credential())
{
cred.Password = password;
cred.Target = PasswordName;
cred.Type = CredentialType.Generic;
cred.PersistanceType = PersistanceType.LocalComputer;
cred.Save();
}
}
catch
(Exception ex)
{
}
}
//retrieve password from the windows vault store using Credential Manager
public
string
GetPassword()
{
try
{
using
(var cred =
new
Credential())
{
cred.Target = PasswordName;
cred.Load();
return
cred.Password;
}
}
catch
(Exception ex)
{
}
return
""
;
}
Reply
Answers (
3
)
datatable editable textbox value in excel in jquery
Select, Insert, Update and Delete data with DataGrideView