Wednesday, June 3, 2009

Allow numbers (0-9), and periods (.) for Registration form(Asp.net+C#)

string password=string.empty /* (Give ur password here) */

if (!Regex.IsMatch( password, "^[-0-9a-zA-Z_.]{3,25}$"))
{

Response.Write("Sorry, only letters (a-z), numbers (0-9), and periods (.) are allowed for
password.");

}

No comments:

Post a Comment