Returns a stream of Unicode bytes from the give SecureString instance
Syntax
Example
Library/Library.Test/TestSecureString.cs
C# | Copy Code |
---|
byte[] expect = Encoding.Unicode.GetBytes(TEST_PASSWORD);
foreach (SecureString ss in MakeStrings())
{
Assert.AreEqual(expect, IOStream.ReadAllBytes(SecureStringUtils.ToStream(ss)));
Assert.AreEqual(TEST_PASSWORD, IOStream.ReadAllText(SecureStringUtils.ToStream(ss), Encoding.Unicode));
} |
VB.NET | Copy Code |
---|
Dim expect As Byte() = Encoding.Unicode.GetBytes(TEST_PASSWORD)
For Each ss As SecureString In MakeStrings()
Assert.AreEqual(expect, IOStream.ReadAllBytes(SecureStringUtils.ToStream(ss)))
Assert.AreEqual(TEST_PASSWORD, IOStream.ReadAllText(SecureStringUtils.ToStream(ss), Encoding.Unicode))
Next |
Requirements
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
See Also