IUserIsPasswordMatch Method |
Namespace: AskiaPortalCmn
This example show how to use the IsPasswordMatch method
using system; using AskiaPortalCmn; namespace MyApp { class Program { static void Main(string[] args) { var context = ContextFactory.CreateByLoginAndPassword("login", "secret"); var contextValidation = context.Validate(); if (!contextValidation.Success) { Console.Error.WriteLine("Invalid context"); Console.Error.Write(contextValidation.Exception.Message); return; } Console.WriteLine("Match `secret`: " + context.user.IsPasswordMatch("secret")); Console.WriteLine("Match `wrong`: " + context.user.IsPasswordMatch("wrong")); // ---> Produce // ""Match `secret`: True" // ""Match `wrong`: False" } } }