Convert String to SecureString

Developer404 picture Developer404 · Oct 15, 2009 · Viewed 160.6k times · Source

How to convert String to SecureString?

Answer

Hossein Narimani Rad picture Hossein Narimani Rad · Mar 29, 2017

There is also another way to convert between SecureString and String.

1. String to SecureString

SecureString theSecureString = new NetworkCredential("", "myPass").SecurePassword;

2. SecureString to String

string theString = new NetworkCredential("", theSecureString).Password;

Here is the link