当前位置:编程学习 > asp >>

简单的检查输入email是否合法程序

答案:function chkEmail(email)
on error resume next
dim i,l,pos1,pos2
chkEmail=true
if isnull(email) then chkEmail=false:exit function
pos1= instr(email,"@")
pos2=instrRev(email,".")
if not(pos1>0) or not (pos2>0) or pos1>pos2 then
chkEmail=false
end if
if err.number<>0 then err.clear
end function

以上资料由动网先锋(http://www.aspsky.net)整理制作,转载请说明出处!

上一个:正则表达式简介(微软)--10.字符匹配
下一个:编译错误:errno undeclared的解决

CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,