Verify the validity of Custom Email formats in Asp.net 2.0 (sample code download)

Source: Internet
Author: User
Tags manual writing
(1). Overview and functions Two methods are used to verify the email format, Asp.net verification control and manual writing. Code Verification. It uses the simple factory and appropriate product design mode, code reconstruction technology, to verify the validity of custom email addresses, and complete the following functions: Question 1 1 . Email Format: User@server.domain.   For example : King.Cheng@hotmail.com or King.Cheng@hotmail.com.cn or King.Cheng@hotmail.com.cn.c.d 2 . Email Only one address is allowed. @ Symbol. 3 . Username Section A) Enter a username. B) It can only start with a number or letter C) Can contain" . "" - "" _ "" ~ The other symbols are invalid. D) Cannot start with a special symbol 4 . Domain Name Section A) The domain name can only contain numbers or letters and cannot contain special characters. B) Enter a domain name or server 5 . Pass DNS Can access this email server, instead WWW Server. For example, Hotmail . Com The email server can access, Hotmail . Com Of HTTP Service But not necessarily the mail server. Question 2 Rebuild with regular expression Question1 , The above 5 No need to implement . (2). Answer Download the code and open the solution: Validateemail. sln Question 1: Engineering : Validateemail answers to this question Question 2: Engineering : Validateemail_refactor: answer to this question [reconstruction project] The reconstructed class structure is as follows:

(3) Download Sample Code Http://files.cnblogs.com/ChengKing/ManuValidateEmail.rar

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.