打开user/reg/UserRegResult.asp 找到73行左右
If UserName = "" Or KS.strLength(UserName) > UserNameMaxChar Or KS.strLength(UserName) < UserNameLimitChar Then
Response.Write("<script>alert('请输入用户名(不能大于" & UserNameMaxChar & "小于" & UserNameLimitChar & ")');history.back();</script>")
Exit Sub
ElseIF KS.FoundInArr(EnabledUserName, UserName, "|") = True Then
Response.Write("<script>alert('您输入的用户名为系统禁止注册的用户名');history.back();</script>")
Exit Sub
ElseIF InStr(UserName, "=") > 0 Or InStr(UserName, ".") > 0 Or InStr(UserName, "%") > 0 Or InStr(UserName, Chr(32)) > 0 Or InStr(UserName, "?") > 0 Or InStr(UserName, "&") > 0 Or InStr(UserName, ";") > 0 Or InStr(UserName, ",") > 0 Or InStr(UserName, "'") > 0 Or InStr(UserName, ",") > 0 Or InStr(UserName, Chr(34)) > 0 Or InStr(UserName, Chr(9)) > 0 Or InStr(UserName, " ") > 0 Or InStr(UserName, "$") > 0 Or InStr(UserName, "*") Or InStr(UserName, "|") Or InStr(UserName, """") > 0 Then
Response.Write("<script>alert('用户名中含有非法字符');history.back();</script>")
Exit Sub
End If
修改为:
If UserName = "" Or KS.strLength(UserName) > UserNameMaxChar Or KS.strLength(UserName) < UserNameLimitChar Then
Response.Write("<script>alert('请输入用户名(不能大于" & UserNameMaxChar & "小于" & UserNameLimitChar & ")');history.back();</script>")
Exit Sub
Elseif KS.HasChinese(username) then
Response.Write("<script>alert('对不起,系统设置用户名不能含有中文!');history.back();</script>")
Exit Sub
ElseIF KS.FoundInArr(EnabledUserName, UserName, "|") = True Then
Response.Write("<script>alert('您输入的用户名为系统禁止注册的用户名');history.back();</script>")
Exit Sub
ElseIF InStr(UserName, "-") > 0 Or InStr(UserName, "=") > 0 Or InStr(UserName, ".") > 0 Or InStr(UserName, "%") > 0 Or InStr(UserName, Chr(32)) > 0 Or InStr(UserName, "?") > 0 Or InStr(UserName, "&") > 0 Or InStr(UserName, ";") > 0 Or InStr(UserName, ",") > 0 Or InStr(UserName, "'") > 0 Or InStr(UserName, ",") > 0 Or InStr(UserName, Chr(34)) > 0 Or InStr(UserName, Chr(9)) > 0 Or InStr(UserName, " ") > 0 Or InStr(UserName, "$") > 0 Or InStr(UserName, "*") Or InStr(UserName, "|") Or InStr(UserName, """") > 0 Then
Response.Write("<script>alert('用户名中含有非法字符');history.back();</script>")
Exit Sub
End If
即增加红色的代码,这样会员名称就不能含有中文名称了。。
还有一个地方:
user/reg/regajax.asp,增加红色的
Sub CheckUserName()
dim username:username=UnEscape(KS.S("username"))
if username="" then
KS.Echo escape("err|请输入会员名!")
elseif InStr(UserName, "=") > 0 Or InStr(UserName, ".") > 0 Or InStr(UserName, "%") > 0 Or InStr(UserName, Chr(32)) > 0 Or InStr(UserName, "?") > 0 Or InStr(UserName, "&") > 0 Or InStr(UserName, ";") > 0 Or InStr(UserName, ",") > 0 Or InStr(UserName, "'") > 0 Or InStr(UserName, ",") > 0 Or InStr(UserName, Chr(34)) > 0 Or InStr(UserName, Chr(9)) > 0 Or InStr(UserName, " ") > 0 Or InStr(UserName, "$") > 0 Or InStr(UserName, "*") Or InStr(UserName, "|") Or InStr(UserName, """") > 0 Then
KS.Echo escape("err|用户名中含有非法字符!")
Elseif KS.HasChinese(username) then
KS.Echo escape("err|对不起,系统设置用户名不能含有中文!")
elseif KS.StrLength(username)<KS.ChkClng(KS.Setting(29)) or KS.StrLength(username)>KS.ChkClng(KS.Setting(30)) then
KS.Echo escape("err|输入的会员名长度应为<font color=#ff6600>" & KS.Setting(29) &"-" & KS.Setting(30) & "位</font>!")
elseif KS.FoundInArr(KS.Setting(31), UserName, "|") = True Then
KS.Echo escape("err|您输入的用户名为系统禁止注册的用户名</font>!")
elseif conn.Execute("Select top 1 Userid From KS_User where username='"&username&"'" ).eof Then
KS.Echo escape("ok|恭喜,该会员名可以正常注册!")
else
KS.Echo escape("err|该会员名已经有人使用!")
end if
End Sub