private void button1_Click(object sender, EventArgs e) { if (textBox1.Text.Trim() != "") { Match rex = Regex.Match(textBox1.Text.Trim(' '), "^([0-9a-zA-Z]([-.\\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\\w]*[0-9a-zA-Z]\\.)+ [a-zA-Z]{2,3})$", RegexOptions.IgnoreCase); if (rex.Success == false) { MessageBox.Show("Please Enter a valid Email-Address ", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); textBox1.Focus(); return false; } else { return true; } } else
{ return true;
}
}
|
No responses found. Be the first to respond and make money from revenue sharing program.
|