检测用户名是否己注册
这是我们常会用的到代码了,你要好好记住啊.检测用户名是否己注册
Sub Checkname()
Dim Rs,SQL,UserEmail
UserEmail = Newasp.checkstr(Trim(XmlDoc.documentElement.selectSingleNode("email").text))
If IsValidEmail(UserEmail) = False Then
Messenge = "<li>您的Email有错误!</li>"
Status = 1
Exit Sub
End If
If CInt(Newasp.ChkSameMail) = 1 Then
Set Rs = Newasp.Execute("SELECT userid FROM NC_User WHERE usermail='" & UserEmail & "'")
If Not Rs.EOF Then
Status = 1
Messenge = "<li>此邮箱["&UserEmail&"]已经占用,请您换一个邮箱再注册吧。</li>"
Exit Sub
End If
Rs.Close:Set Rs = Nothing
End If
Set Rs = Newasp.Execute("SELECT username FROM NC_User WHERE username = '" & UserName & "'")
If Not (Rs.bof And Rs.EOF) Then
Status = 1
Messenge = "<li>Sorry!此用户已经存在,请换一个用户名再试!</li>"
Else
Status = 0
Messenge = "<li><font color=red><b>" & UserName & "</b></font> 尚未被人使用,赶紧注册吧!</li>"
End If
Rs.Close:Set Rs = Nothing
End Sub