欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

一個(gè)判斷email合法性的函數(shù)[非正則]

 更新時(shí)間:2008年12月09日 12:31:17   作者:  
沒用到正則,看起來這個(gè)函數(shù)的準(zhǔn)確度還是比較高的。

<%
Function IsValidEmail(email)
Dim names, Name, i, c
IsValidEmail = True
names = Split(email, "@")
If UBound(names) <> 1 Then
IsValidEmail = False
Exit Function
End If
For Each Name In names
If Len(Name) <= 0 Then
IsValidEmail = False
Exit Function
End If
For i = 1 To Len(Name)
c = LCase(Mid(Name, i, 1))
If InStr("abcdefghijklmnopqrstuvwxyz_-.", c) <= 0 And Not IsNumeric(c) Then
IsValidEmail = False
Exit Function
End If
Next
If Left(Name, 1) = "." Or Right(Name, 1) = "." Then
IsValidEmail = False
Exit Function
End If
Next
If InStr(names(1), ".") <= 0 Then
IsValidEmail = False
Exit Function
End If
i = Len(names(1)) - InStrRev(names(1), ".")
If i <> 2 And i <> 3 Then
IsValidEmail = False
Exit Function
End If
If InStr(email, "..") > 0 Then
IsValidEmail = False
End If
End Function
%>

相關(guān)文章

最新評論