How do I validate email address formatting with the .NET Framework?

前端 未结 11 608
孤城傲影
孤城傲影 2020-11-29 05:49

I want a function to test that a string is formatted like an email address.

What comes built-in with the .NET framework to do this?

This works:



        
11条回答
  •  离开以前
    2020-11-29 06:28

    You could use a Regex to do this.

    There have been written a lot of articles about it; this came up when I searched google for 'regex to validate email address': Find or Validate an Email Address.

提交回复
热议问题