Convert String to SecureString

前端 未结 13 1943
粉色の甜心
粉色の甜心 2020-12-12 15:43

How to convert String to SecureString?

13条回答
  •  渐次进展
    2020-12-12 16:24

    You can follow this:

    string password = "test";
    SecureString sec_pass = new SecureString();
    Array.ForEach(password.ToArray(), sec_pass.AppendChar);
    sec_pass.MakeReadOnly();
    

提交回复
热议问题