Returns a stream from which the password can be read
Syntax
Visual Basic (Declaration) | |
---|
Public Function ReadText() As TextReader |
Example
Library/Library.Test/TestPassword.cs
C# | Copy Code |
---|
byte[] pwdBytes = Guid.NewGuid().ToByteArray();
using (Password pwd = new Password(false, pwdBytes))
{
Assert.AreEqual(pwdBytes, IOStream.ReadAllBytes(pwd.ReadBytes()));
}
using (Password pwd = new Password(TEST_PASSWORD))
{
Assert.AreEqual(TEST_PASSWORD, pwd.ReadText().ReadToEnd());
} |
VB.NET | Copy Code |
---|
Dim pwdBytes As Byte() = Guid.NewGuid().ToByteArray()
Using pwd As New Password(False, pwdBytes)
Assert.AreEqual(pwdBytes, IOStream.ReadAllBytes(pwd.ReadBytes()))
End Using
Using pwd As New Password(TEST_PASSWORD)
Assert.AreEqual(TEST_PASSWORD, pwd.ReadText().ReadToEnd())
End Using |
Requirements
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
See Also