asp.net 2.0 implementation of custom email format validation (sample code download)

Source: Internet
Author: User
Tags mail domain domain name
asp.net| Example | download (a). Overview and FunctionsTwo methods are used to validate the email format, asp.net the validation controls, and manually write code validation. and use it to simple factory and fitting design patterns, code refactoring technology. Implement custom email address validation and complete the following functions: Question 11. The Email format is user@server.domain. For example: King.Cheng@hotmail.com or King.Cheng@hotmail.com.cn or King.cheng@hotmail.com.cn.c.d 2. An Email address can have only one @ sign. 3. User name part A) user name is not nullable B) can contain "." Only as a number or letter C). "-" "_" "~" symbol, other sign illegal d) can not start with a special symbol 4. Domain name part A) domain name can only be numbers or letters, cannot use special symbol B domain name or server cannot be empty 5. This mail server can be accessed through DNS, not the WWW server. For example, a Hotmail.com mail server can be accessed, but a Hotmail.com HTTP server is not necessarily a mail server. Question 2Using regular expressions to refactor Question1, the top 5 does not have to be implemented. (b). AnswerDownload the code and open the solution: ValidateEmail.sln Question 1:Project: Validateemail answer to this question Question 2:Project: Validateemail_refactor answer to this question [reconstructed project] the class structure after refactoring is as follows:

(iii). Sample code Download          Http://www.cnblogs.com/Files/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.