CSharpTest.Net
ReadText Method
See Also  Example Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.Crypto Namespace > Password Class : ReadText Method

Glossary Item Box

Returns a stream from which the password can be read

Syntax

Visual Basic (Declaration) 
Public Function ReadText() As TextReader
C# 
public TextReader ReadText()

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.NETCopy 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

Generated with Document! X 2011 by Innovasys