Website Validiting in C#
|
|
if (txtWebsite.Text != "")
{
if (!isWeb(txtWebsite.Text))
{
MessageBox.Show("Please Enter Valid Website Name");
txtWebsite.Focus();
txtWebsite.SelectAll();
}
else
{
txtEmail.Focus();
txtEmail.SelectAll();
}
}
else
{
txtEmail.Focus();
txtEmail.SelectAll();
}
public static bool isWeb(string inputWebsitel)
{
return Regex.IsMatch(inputWebsitel,@"^(((ht|f)tp(s?))\://)?(www.|[a-zA-Z].)[a-zA-Z0-9\-\.]+\.(com|edu|gov|mil|net|org|biz|info|name|museum|us|ca|uk)(\:[0-9]+)*(/($|[a-zA-Z0-9\.\,\;\?\'\\\+&%\$#\=~_\-]+))*$");
}
Categories: Personal, C#, Critical
Post a Comment
Oops!
The words you entered did not match the given text. Please try again.
Oops!
Oops, you forgot something.