注册 登录
编程论坛 ASP技术论坛

求:asp 检验邮件格式代码

Adalmy123 发布于 2008-02-04 16:52, 1089 次点击
高手们,小女子求:asp 检验邮件格式代码 ,请帮帮忙。。。


谢谢罗。。。。。。
5 回复
#2
hmhz2008-02-04 17:02
被调用函数
<%
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
%>

<%
Email=Trim(request.form("Email"))
if not isemail(Email) then
response.write "对不起,Email格式不对!"
end if
%>
#3
Adalmy1232008-02-04 22:47

非常感谢。。。。
#4
Adalmy1232008-02-10 15:20
<script language="vbscript">  
//检验邮件格式的正确
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 if
End Function
</script>


这样写错在哪里?
#5
lele20072008-02-11 22:11
[bo]以下是引用 [un]Adalmy123[/un] 在 2008-2-4 22:47 的发言:[/bo]


非常感谢。。。。

改成这样试试:
<script language="vbscript" runat="server">  
//检验邮件格式的正确
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 if
End Function
</script>
-----------11111-------
<script language="vbscript">
vbs代码
</script>

----------22222--------
<script language="vbscript" runat="server">
vbs代码
</script>
--------------------------
11111:是在客户端执行的
22222:是在服务端执行的


[[it] 本帖最后由 lele2007 于 2008-2-11 22:13 编辑 [/it]]
#6
Adalmy1232008-02-12 01:58
我发现自己的ASP,JAVA,VBSCRIPT都不好。。。请问有什么教程不?
1