最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
asp 删除用户程序
时间:2008-07-14 编辑:简简单单 来源:一聚教程网
网站管理员可以根据用户在网站的活动与合法性进行管理,如果实现是无法可忍的可以删除用户,这里不到是说是删除用户可以删除文件等,这只是一个简单的文件程序了,看了以后你自己怎么使用是你自己的事喽.
Sub Deleteuser()
Dim Del_Users,i,AllUserID,Del_UserName
Dim Rs
Del_Users = Split(UserName,",")
For i = 0 To UBound(Del_Users)
Del_UserName = Newasp.CheckBadstr(Del_Users(i))
Set Rs = Newasp.Execute("SELECT userid,username FROM [NC_User] WHERE UserName='" & Del_UserName & "'")
If Not (Rs.Eof And Rs.Bof) Then
AllUserID = AllUserID & Rs(0) & ","
Newasp.Execute("UPDATE NC_Message SET delsend=1 WHERE sender='"& Newasp.CheckStr(Rs(1)) &"'")
Newasp.Execute("DELETE FROM NC_Message WHERE flag=0 And incept='"& Newasp.CheckStr(Rs(1)) &"'")
Messenge = Messenge & "
End If
Next
Set Rs = Nothing
If AllUserID <> "" Then
If Right(AllUserID,1) = "," Then AllUserID = Left(AllUserID,Len(AllUserID)-1)
Newasp.Execute ("DELETE FROM NC_User WHERE userid in (" & AllUserID & ")")
Newasp.Execute ("DELETE FROM NC_Favorite WHERE userid in (" & AllUserID & ")")
Newasp.Execute ("DELETE FROM NC_Friend WHERE userid in (" & AllUserID & ")")
End If
Status = 0
End Sub
相关文章
- VBS 批量Ping的项目讲解 09-19
- 如何封装一个Ajax函数介绍 09-16
- ASP实现加法验证码方法 09-16
- ASP错误捕获的几种常规处理方法介绍 09-16
- ajax实现城市三级联动的代码介绍 09-16
- asp中获取日期为星期几的技巧 09-14