Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public bool ValidEmailAddress(string emailAddress)
- {
- // Confirm that the email address is not empty.
- if (emailAddress.Length == 0)
- {
- MessageBox.Show("Please, enter your email");
- return false;
- }
- // Confirm that there is an "@" and a "." in the email address, and in the correct order.
- if (emailAddress.IndexOf("@") > -1)
- {
- if (emailAddress.IndexOf(".", emailAddress.IndexOf("@")) > emailAddress.IndexOf("@"))
- return true;
- }
- MessageBox.Show("Invalid input format of email! "+
- "Example: 'someone@example.com' ");
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement