<% dim RegUserName,FoundErr,ErrMsg RegUserName=trim(request("UserName")) if RegUserName="" or strLength(RegUserName)>14 or strLength(RegUserName)<4 then founderr=true errmsg=errmsg & "
  • 请输入用户名(不能大于14小于4)
  • " else if Instr(RegUserName,"=")>0 or Instr(RegUserName,"%")>0 or Instr(RegUserName,chr(32))>0 or Instr(RegUserName,"?")>0 or Instr(RegUserName,"&")>0 or Instr(RegUserName,";")>0 or Instr(RegUserName,",")>0 or Instr(RegUserName,"'")>0 or Instr(RegUserName,",")>0 or Instr(RegUserName,chr(34))>0 or Instr(RegUserName,chr(9))>0 or Instr(RegUserName,"")>0 or Instr(RegUserName,"$")>0 then errmsg=errmsg+"
  • 用户名中含有非法字符
  • " founderr=true end if end if if founderr=false then dim sqlCheckReg,rsCheckReg sqlCheckReg="select * from " & db_User_Table & " where " & db_User_Name & "='" & RegUserName & "'" set rsCheckReg=server.createobject("adodb.recordset") rsCheckReg.open sqlCheckReg,Conn_User,1,1 if not(rsCheckReg.bof and rsCheckReg.eof) then founderr=true errmsg=errmsg & "
  • “" & RegUserName & "”已经存在!请换一个用户名再试试!
  • " else end if rsCheckReg.close set rsCheckReg=nothing end if %> 检查用户名
    <% if founderr=false then call Success() else call WriteErrmsg() end if %> <% call CloseConn_User sub WriteErrMsg() response.write "" response.write "" response.write "" response.write "
    错误提示
    " & errmsg & "

    关 闭

    " end sub sub Success() response.write "" response.write "" response.write "" response.write "
    恭喜你!

    “" & RegUserName & "”尚未被人使用,赶紧注册吧!

    关 闭

    " end sub %>