文章·资料 电脑软件 手机应用 网站源码




    本 站 搜 索
   推 荐 文 章        More...
华硕易电脑(ASUS Eee PC 1025C..
先来段开场白:为了外出携带方便,到淘..
Acronis True Image 使用说明
  一款可以在Windows下使用全部功..
Norton Ghost 使用详解
一、分区备份   使用Ghost进行系..
    文 章 阅 读 排 行
“啊估文章软件站”网站系统调..
一、调试测试网站系统时,如何设置程..
Microsoft SQL Server 2000 Per..
  对于第一次安装 Microsoft SQL Se..
关于 Firefox 在中国持续运营..
亲爱的 Firefox 用户及 Firefox 社区..
CMD:列出当前文件夹的全部文件..
电脑硬盘里,某个文件夹里的文件夹和..
关于使用 CSS 来控制 table 标..
  在 HTML 语言中,table 标签的 cel..
入侵Oracle数据库常用操作命令
  最近遇到一个使用了Oracle数据库..
全球IP地址段
203.026.005.000|203.026.005.255|澳..
ASP/JavaScript:不刷新页面检..
function GuReturnElement(Elemen..
全国各地、公共 DNS 服务器
排序 地区/公司名称 IPv..
Windows 系统安装或备份时 ISO,..
【ISO 文件】 ISO 文件其实就是光..
 文 章 信 息
ASP检测表单输入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) <> 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

文章作者:未知  更新日期:2006-09-12
〖文章浏览:〗〖发送文章〗〖打印文章
相关文章 ·asp检测是否外部提交数据过程2006-05-13