|
|
|
|
|
Dicas
|
|
Visual Basic (Validações)
|
|
|
Título da Dica: Validando um endereço de e-mail
|
|
|
|
Postada em 9/12/2004 por Snake
Private Function EmailOK(ByVal Email As String) As Boolean Dim j As Long, C As String If Email = "" Or Email Like "*@*" And _ (Email Like "*.??" Or Email Like "*.???") _ Then EmailOK = True
If Email Like "*.???" Then C = Right$(Email, 4) If C = ".com" Or C = ".net" Or C = ".edu" _ Or C = ".mil" Or C = ".gov" Or C = ".org" Then Else EmailOK = False End If End If
For j = 1 To Len(Email) C = Mid$(Email, j, 1) If C = "@" Or C = "." Or C = "-" Or C = "_" _ Or C >= Chr(48) And C <= Chr(57) _ Or LCase(C) >= Chr(97) And _ LCase(C) <= Chr(122) Then Else EmailOK = False End If Next j End Function
|
|
|
|
|