Instantiates a new SecureString object by passing its constructor a pointer to a character array. : SecureString « Security « C# / CSharp Tutorial






using System;
using System.Security;

public class Example
{
   unsafe public static void Main()
   {
      SecureString testString;
      char[] chars = { 't', 'e', 's', 't' };

      fixed(char* pChars = chars)
      {
         testString = new SecureString(pChars, chars.Length);
      }
      Console.WriteLine(testString.Length);
   }
}








35.16.SecureString
35.16.1.Instantiates a new SecureString object by passing its constructor a pointer to a character array.
35.16.2.Read password from console