使用Windows.Security.Credentials.PasswordVault
该类,我可以访问存储在 Windows 凭据管理器中“Web 凭据”下的密码:
using System;
using Windows.Security.Credentials;
class Program {
static void Main(string[] args) {
PasswordVault vault = new PasswordVault();
foreach (var cred in vault.RetrieveAll()) {
cred.RetrievePassword();
Console.WriteLine("Resource: {0}", cred.Resource);
Console.WriteLine("UserName: {0}", cred.UserName);
Console.WriteLine("Password: {0}", cred.Password);
}
}
}
我想知道是否有办法检索存储在“Windows 凭据”下的凭据。