- UID
- 277
金牌会员
- 经验
- 点
- 和山币
- 枚
- 积分
- 34171
- 阅读权限
- 70
- 注册时间
- 2005-11-4
- 最后登录
- 1970-1-1
|
徒弟就不收了哈
代码贴上自己看
-
- <!--#include file="conn.asp"-->
- <%
- set rs=conn.execute("select * from email order by id asc")
- if rs.bof and rs.eof then
- response.Write "数据库怎么是空的?"
- else
- delid="0"
- do while not rs.eof
- if len(split(rs(1),"@")(0))<4 then
- delid=delid&","&rs(0)
- response.Write rs(1)&"已经删除.原因:<span style='color:red'>@前面不足四个字符</span><br />"
- end if
-
- if ubound(split(rs(1),"@"))<>1 then
- delid=delid&","&rs(0)
- response.Write rs(1)&"已经删除.原因:<span style='color:red'>多个@ 或者没有@</span><br />"
- else
- if ubound(split(split(rs(1),"@")(1),"."))<1 or ubound(split(split(rs(1),"@")(1),"."))>4 then
- delid=delid&","&rs(0)
- response.Write "已经删除.原因:<span style='color:red'>@ 后面没有 '.' 或者 '.'数量过多</span><br />"
- else
-
- if split(split(rs(1),"@")(1),".")(0)="56" or split(split(rs(1),"@")(1),".")(0)="" or split(split(rs(1),"@")(1),".")(1)="" then
- delid=delid&","&rs(0)
- response.Write rs(1)&"已经删除.原因:<span style='color:red'>56邮箱已经不能用了,@ 后面 . 前后 不能为空</span><br />"
- end if
- end if
- end if
- if instr(rs(1),"net")<1 and instr(rs(1),"org")<1 and instr(rs(1),"com")<1 and instr(rs(1),"cn")<1 and instr(rs(1),"edu")<1 and instr(rs(1),"gov")<1 and instr(rs(1),".")<1 then
- delid=delid&","&rs(0)
- response.Write rs(1)&"已经删除.原因:<span style='color:red'>这啥牌子的邮箱啊</span><br />"
- end if
- set rss=conn.execute("select * from email where id >"&rs(0)&" order by id asc")
- if rss.bof and rss.eof then
- else
- if rss(1)=rs(1)then
- delid=delid&","&rs(0)
- response.Write rs(1)&"已经删除.原因:<span style='color:red'>重复的邮箱地址</span><br />"
- end if
- end if
- rs.movenext
- loop
- end if
- rs.close
- set rs=nothing
- conn.execute("delete from email where id in ("&delid&")")
- response.Write delid
- response.Write "删除 ok !"
- %>
复制代码
conn.asp
-
- <%
- dim conn
- dim connstr
- dim db
- db = "sdf.mdb"
- connstr = "Provider = Microsoft.Jet.OLEDB.4.0;Data Source = " & Server.MapPath(db)
- Set conn = Server.CreateObject("ADODB.Connection")
- if err Then
- err.clear
- end if
- conn.Open connstr
- %>
复制代码 |
-
2.gif
(263.02 KB, 下载次数: 13)
-
3.gif
(88.18 KB, 下载次数: 14)
评分
-
查看全部评分
|