当前位置:编程学习 > asp >>

asp 删除用户程序

asp 删除用户程序

网站管理员可以根据用户在网站的活动与合法性进行管理,如果实现是无法可忍的可以删除用户,这里不到是说是删除用户可以删除文件等,这只是一个简单的文件程序了,看了以后你自己怎么使用是你自己的事喽.

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 & "<li>用户(" & Del_UserName & ")删除成功。</li>"
  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

补充:asp教程,ASP入门
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,