我们经常会看到在BBS里面禁止用户发贴,或锁定用户不能登录等,下面我们就来看看这些功能是怎么用程序实现的吧.
Sub Lockuser()
Dim UserStatus
If XmlDoc.documentElement.selectSingleNode("userstatus") is Nothing Then
Messenge = "
参数非法,中止请求。"
Status = 1
Exit Sub
ElseIf Not IsNumeric(XmlDoc.documentElement.selectSingleNode("userstatus").text) Then
Messenge = "参数非法,中止请求。"
Status = 1
Exit Sub
Else
UserStatus = Clng(XmlDoc.documentElement.selectSingleNode("userstatus").text)
End If
If UserStatus = 0 Then
Newasp.Execute ("UPDATE NC_User SET UserLock=0 WHERE Username='" & UserName & "'")
Else
Newasp.Execute ("UPDATE NC_User SET UserLock=1 WHERE Username='" & UserName & "'")
End If
Status = 0
End Sub