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;
            }

Comments

Popular posts from this blog

SharePoint 2013: Error updating managed account credentials

How can I call a JIRA api through Powershell?