Sunday, October 21, 2018

C#: Convert SecureString to String

Sample code to convert C# SecureString to String. Note that this is not the most secure to access SecureString.

Line 20 is one example of converting SecureString to String, this only works for .Net Framework 4.0 or later.

Lines 23 to 38 converts SecureString to String and works using .Net Framework 2.0 or up.

Reference(s):
https://stackoverflow.com/questions/818704/how-to-convert-securestring-to-system-string
</>

No comments:

Test page for code formatting

netsh advfirewall firewall add rule name = "RPC Endpoint Mapper" dir = in action = allow protocol = TCP localport = 1...