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) <> 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

时间: 2024-08-02 23:34:27

asp 电子邮箱email验证实例程序的相关文章

jquery验证邮箱email验证实例

前段时间处理了验证手机,金额,小数点等验证.最近做页面的时候,又遇到了一个验证邮箱的,过程不多说,直接看代码.实现关键还是正则,正则表达式很强大.有机会,好好学学,但是是学好,感觉不容易.还好一些常用的,网上可以找到.但是看懂是必须要做到的~~  代码如下 复制代码 $(function(){  $("#email").blur(function(){   var txt_value = $(this).val();   if(txt_value==""){   

jquery邮箱 密码验证实例(jquery 验证插件)

  <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.111cn.net/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.111cn.net/ 1999/xhtml"> <head> <meta http-equiv="

邮箱地址验证实例

下面这款正则表达式可以验证多个邮箱地址 ^([a-za-z0-9_-])+@([a-za-z0-9_-])+((.[a-za-z0-9_-]{1,4}){1,4})$ 关键是(.[a-za-z0-9_-]{1,4}) 看一款asp教程邮箱验证实例   <% function isemail(strng) isemail = false dim regex, match set regex = new regexp regex.pattern = "^w+((-w+)|(.w+))*@[a-

asp.net生成图形验证代码程序

asp教程.net生成图形验证代码程序 void palm::display() {     glloadidentity();                                 // 重置当前的模型观察矩阵     glcolor3f(.0f,1.0f,1.0f);        //绘制手掌四周     glbegin(gl_quad_strip);         glvertex3f(  -39.5000     ,     37.7987  ,   10.0000 ) ;

js email 电子邮箱地址验证程序

原代码是这样的:  代码如下 复制代码 function isValidMail(sText){  var reMail = /^(?:w+.?)*w+@(?:w+.?)*w+$/;  return reMail.test(sText); } 似乎 这样验证像sofish@163.com这样的邮箱是没问题的.但,由于仔细看一下在AT(@)后面的非捕获性引用中,使用的是*(出现任意次):  代码如下 复制代码 var reMail = /^(?:w+.?)*w+@(?:w+.?)*w+$/; 那么

四种asp 电子邮箱验证函数

Public Function IsEmail(ByVal PString) Dim Plt,Pgt : Plt = False : Pgt = False For x = 2 To Len(PString) - 1 If Mid(PString,x,1) = "@" Then Plt = True If Mid(PString,x,1) = "." And Plt = True Then Pgt = True Next If Plt = True And Pgt

ASP实现一行多列显示方法实例程序

程序|显示 好不容易写了点东西,但由于鼠标太灵敏的缘故,还没提交网页就不小心被关了.郁闷了.写简单点. asp一行多列显示常用的方法是用两个循环语句控制表格的列数和总记录数. 今天想到用div来控制.大致也能实现,但不知是否合适.如下: <%do while not rs.eof%> <div id="AmdiManageType"><input name="txtManageTypeID" type="checkbox&qu

ASP实现的日历代码实例程序

程序|日历 <style> td { font-family: "宋体"; font-size:9pt} </style> <body bgcolor="eeeeee"> <table width="180" cellpadding="0" cellspacing="1" bgcolor="dddddd" align=center> <

asp 完美sql防注入实例程序

Dim Query_Badword,Form_Badword,i,Err_Message,Err_Web,name '------定义部份  头---------------------------------------------------------------------- Err_Message = 1  '处理方式:1=提示信息,2=转向页面,3=先提示再转向 Err_Web = "Err.Asp" '出错时转向的页面 Query_Badword="'∥and∥