Account lock when entered maximum number of wrong passwords programatically

Hi ,
When user enter maximum wrong password , account should be locked and notify user with a pop up saying account has been locked out , please reach out to Admin.

How can I programatically achive this in C# and WPF.

Ramesh M