10 September 2004
C# Password Validation
Posted by Mikhail Esteves under: C#; Tips .
The following function uses a Regular Expression, which you can tweak to just about anything, to check if a password is 8 to 15 in length and contains atleast one digit or symbol.
using System.Text.RegularExpressions;
public bool ValidatePassword(string tPass)
{
Regex passreg = new Regex("^(?=.*[d$!%^&*()]).{8,15}$”);
Returns true if it matches, false if it doesn’t!
One Comment so far...
IVAN RIOS Says:
15 September 2004 at 11:22 pm.
Quisiera saber como hago para comparar el password que digita el usuario con el que tengo en mi base de datos.
La base de datos que estoy utilizando es MySql y el lenguaje de programacion es C#.