asp

位置:IT落伍者 >> asp >> 浏览文章

asp 电子邮箱email验证实例程序


发布日期:2021年11月02日
 
asp 电子邮箱email验证实例程序

电子邮箱email验证实例程序
function IsValidEmail(email)
dim names name i c
Check for valid syntax in an email address
IsValidEmail = true
names = Split(email "@")
if UBound(names) <> then
IsValidEmail = false
exit function
end if
for each name in names
if Len(name) <= then
IsValidEmail = false
exit function
end if
for i = to Len(name)
c = Lcase(Mid(name i ))
if InStr("abcdefghijklmnopqrstuvwxyz_" c) <= and not IsNumeric(c) then
IsValidEmail = false
exit function
end if
next
if Left(name ) = "" or Right(name ) = "" then
IsValidEmail = false
exit function
end if
next
if InStr(names() "") <= then
IsValidEmail = false
exit function
end if
i = Len(names()) InStrRev(names() "")
if i <> and i <> then
IsValidEmail = false
exit function
end if
if InStr(email "") > then
IsValidEmail = false
end if

end function

上一篇:asp限制只能中文输入的方法

下一篇:ASP过滤script脚本的正则函数