|
|
|
Click here to copy the following block | Function IsValidEmail(ByVal Value As String, Optional ByVal MaxLength As _ Integer = 255, Optional ByVal IsRequired As Boolean = True) As Boolean If Value Is Nothing OrElse Value.Length = 0 Then Return Not IsRequired ElseIf Value.Length > MaxLength Then Return False End If
If Not System.Text.RegularExpressions.Regex.IsMatch(Value, _ "^[-A-Za-z0-9_@.]+$") Then Return False
Dim i As Integer = Value.IndexOf("@"c) If i <= 0 Or i >= Value.Length - 3 Then Return False If Value.IndexOf("@"c, i + 1) >= 0 Then Return False
Dim j As Integer = Value.LastIndexOf("."c) If j < 0 Or j <= i + 1 Then Return False
Return True End Function |
|
|
|
Submitted By :
Nayan Patel
(Member Since : 5/26/2004 12:23:06 PM)
|
|
|
Job Description :
He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting. |
View all (893) submissions by this author
(Birth Date : 7/14/1981 ) |
|
|