一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

asp 删除用户程序

时间:2022-07-02 22:43:58 编辑:袖梨 来源:一聚教程网


网站管理员可以根据用户在网站的活动与合法性进行管理,如果实现是无法可忍的可以删除用户,这里不到是说是删除用户可以删除文件等,这只是一个简单的文件程序了,看了以后你自己怎么使用是你自己的事喽.
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 & "
  • 用户(" & Del_UserName & ")删除成功。
  • "
      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

    热门栏目