C#: How do I generate a SecureString password?
There is a simple function to generate a secure string password:
public static SecureString StringToSecure(string password)
{
var secure = new SecureString();
foreach (char c in password)
{
secure.AppendChar(c);
}
return secure;
}
public static SecureString StringToSecure(string password)
{
var secure = new SecureString();
foreach (char c in password)
{
secure.AppendChar(c);
}
return secure;
}
Comments
Post a Comment