Visual Basic (Declaration) | |
---|---|
Public Overloads Function VerifyPassword( _ ByVal password As String _ ) As Boolean |
Parameters
- password
Library/Library.Test/TestPasswordHash.cs
C# | Copy Code |
---|---|
using (PasswordHash pwd1 = new PasswordHash(TEST_PASSWORD)) { Assert.IsFalse(pwd1.VerifyPassword(TEST_PASSWORD + " ")); Assert.IsFalse(pwd1.VerifyPassword(TEST_PASSWORD.Substring(0, TEST_PASSWORD.Length-1))); Assert.IsFalse(pwd1.VerifyPassword("")); Assert.IsTrue(pwd1.VerifyPassword(TEST_PASSWORD)); Assert.IsTrue(pwd1.VerifyPassword(Password.Encoding.GetBytes(TEST_PASSWORD))); Assert.IsTrue(pwd1.VerifyPassword(new MemoryStream(Password.Encoding.GetBytes(TEST_PASSWORD)))); Assert.IsTrue(pwd1.VerifyPassword(new Password(TEST_PASSWORD))); } |
VB.NET | Copy Code |
---|---|
Using pwd1 As New PasswordHash(TEST_PASSWORD) Assert.IsFalse(pwd1.VerifyPassword(TEST_PASSWORD + " ")) Assert.IsFalse(pwd1.VerifyPassword(TEST_PASSWORD.Substring(0, TEST_PASSWORD.Length - 1))) Assert.IsFalse(pwd1.VerifyPassword("")) Assert.IsTrue(pwd1.VerifyPassword(TEST_PASSWORD)) Assert.IsTrue(pwd1.VerifyPassword(Password.Encoding.GetBytes(TEST_PASSWORD))) Assert.IsTrue(pwd1.VerifyPassword(New MemoryStream(Password.Encoding.GetBytes(TEST_PASSWORD)))) Assert.IsTrue(pwd1.VerifyPassword(New Password(TEST_PASSWORD))) End Using |
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
Reference
PasswordHash ClassPasswordHash Members
Overload List