主题:验证问题!!急啊!!
fearweki
[专家分:0] 发布于 2005-11-27 22:49:00
在用户填写注册表单的时候,怎么样用VB.net语言编写一段程序来验证用户输入的用户名中是否包含例如:“@”,“$”,“¥”等等的非法字符
先谢谢各位大虾了
回复列表 (共1个回复)
沙发
kskksk [专家分:620] 发布于 2005-11-28 22:09:00
for i=1 to len(bbsuser)
cl=mid(bbsuser,i,1)
if cl="'" or cl="<" or cl=">" or cl="%" or cl="/" or cl="-" or cl="#" or cl="$" then
response.write "<script language='javascript'>"
response.write "alert('用户名中不能有非法字符!!');"
response.write "history.go(-1);"
response.write "</script>"
response.end
end if
next
for i=1 to len(password)
pwd=mid(password,i,1)
if pwd="'" or pwd="<" or pwd=">" or pwd="%" or pwd="/" or pwd="#" or pwd="$" or pwd="-" then
response.write "<script language='javascript'>"
response.write "alert('密码中不能有非法字符!!');"
response.write "history.go(-1);"
response.write "</script>"
response.end
end if
next
我来回复