From a myTextBox.Text to a mySecureString.

  • Thread starter thomasnguyencom
  • Start date
T

thomasnguyencom

What's the best way to handle this situation securely?

I'm currently manually converting the string to a SecureString, but
for some reason it looks ugly.

public SecureString ConvertToSecureString (string str)
{
SecureString secureString = new SecureString();
foreach (char c in str)
{
secureString.AppendChar(c);
}

return secureString;
}

Thanks,
-tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top