System.Utilities.Cryptography.Encryption.ConvertToUnsecureString C# (CSharp) Метод

ConvertToUnsecureString() публичный статический Метод

public static ConvertToUnsecureString ( System securePassword ) : string
securePassword System
Результат string
        public static string ConvertToUnsecureString(System.Security.SecureString securePassword)
        {
            if (securePassword == null)
                throw new ArgumentNullException("securePassword");

            IntPtr unmanagedString = IntPtr.Zero;
            try
            {
                unmanagedString = System.Runtime.InteropServices.Marshal.SecureStringToGlobalAllocUnicode(securePassword);
                return System.Runtime.InteropServices.Marshal.PtrToStringUni(unmanagedString);
            }
            finally
            {
                System.Runtime.InteropServices.Marshal.ZeroFreeGlobalAllocUnicode(unmanagedString);
            }
        }