【威尼斯正规官网】好了下面我们来看看这几种asp
分类:热门资源

%dim emailemail=request.form(email)if IsValidEmail(email) then if request(action)=退订 then response.redirect del_email.asp?email=email else response.redirect add_email.asp?email=email end ifelse 'response.write 无效的电子邮件格式,请按后退按钮,重填一个有效的Email response.writeSCRIPT language=JavaScriptalert('无效的电子邮件格式,请重填一个有效的Email!'); response.writejavascript:history.go(-1)/SCRIPTend iffunction IsValidEmail(email)dim names, name, i, c'Check for valid syntax in an email address.IsValidEmail = truenames = Split(email, @)if UBound(names) 1 then IsValidEmail = false exit functionend iffor 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 ifnextif InStr(names(1), .) = 0 then IsValidEmail = false exit functionend ifi = Len(names(1)) - InStrRev(names(1), .)if i 2 and i 3 then IsValidEmail = false exit functionend ifif InStr(email, ..) 0 then IsValidEmail = falseend ifend function%

本文章提供的下面邮箱验证函数都是经过测试的各位可以放心的使用,有用正则表达式的也有不是的,好了下面我们来看看这几种asp 电子邮箱验证函数是不是你喜欢的风格吧。

本文章提供的下面邮箱验证函数都是经过测试的各位可以放心的使用,有用正则表达式的也有不是的,好了下面我们来看看这几种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 = True Then
IsEmail = True
Else
IsEmail = False
End if
End Function
%>

'********************************************
'函数名:IsValidEmail
'作 用:检查Email地址合法性
'参 数:email ----要检查的Email地址
'返回值:True ----Email地址合法
' False ----Email地址不合法
'********************************************

Public Function IsValidEmail(Email)
Dim names, name, I, c
IsValidEmail = True
names = Split(Email, "@")
If UBound(names) <> 1 Then IsValidEmail = False: Exit Function
For Each name In names
If Len(name) <= 0 Then IsValidEmail = False:Exit Function
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
Next
If Left(name, 1) = "." Or Right(name, 1) = "." Then IsValidEmail = False:Exit Function
Next
If InStr(names(1), ".") <= 0 Then IsValidEmail = False:Exit Function
I = Len(names(1)) - InStrRev(names(1), ".")
If I <> 2 And I <> 3 Then IsValidEmail = False:Exit Function
If InStr(Email, "..") > 0 Then IsValidEmail = False
End Function

 

<%
Function isemail(strng)
isemail = false
Dim regEx, Match
Set regEx = New RegExp
regEx.Pattern = "^w+((-w+)|(.w+))*@[A-Za-z0-9]+((.|-)[A-Za-z0-9]+)*.[A-Za-z0-9]+$"
regEx.IgnoreCase = True
Set Match = regEx.Execute(strng)
if match.count then isemail= true
End Function
%>

 

Public Function ChkMail(ByVal Email)
Dim Rep,Pmail : ChkMail = True : Set Rep = New RegExp
Rep.Pattern = "([.a-zA-Z0-9_-]){2,10}@([a-zA-Z0-9_-]){2,10}(.([a-zA-Z0-9]){2,}){1,4}$"
Pmail = Rep.Test(Email) : Set Rep = Nothing
If Not Pmail Then ChkMail = False
End Function

电子邮...

本文由威尼斯在线注册平台发布于热门资源,转载请注明出处:【威尼斯正规官网】好了下面我们来看看这几种asp

上一篇:剧本暗中认可复制对象.今后PHP5只移动句柄 下一篇:没有了
猜你喜欢
热门排行
精彩图文