代码收藏

作者在 2009-02-20 15:57:08 发布以下内容
'''''''''''''''''''''''''''''''''''''''''''''''用户名和密码检查

function Chk_usrpss(Str,strname,lenmin,lenmax)'lenmin表长度下限,lenmax表长度上限
b=""
c=true
if str="" then
session("errmsg")="对不起,"&strname&"不能为空!"
response.redirect "错误"
response.end
end if
if len(str)<lenmin then
session("errmsg")="对不起,"&strname&"长度应该大于"&lenmin&"位!"
response.redirect "错误"
response.end
end if
if len(str)>lenmax then
session("errmsg")="对不起,"&strname&"长度应该小于"&lenmax&"位!"
response.redirect "错误"
response.end
end if
bString="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"
for i=1  to len(str)
b=mid(str,i,1)
if instr(bstring,b)<=0 then
c=false
exit for
end if
next
if c=false then
session("errmsg")="对不起,"&strname&"不符合规范!"
response.redirect "错误"
response.end
end if
end function
个人收藏 | 阅读 3765 次
文章评论,共0条
游客请输入验证码
浏览10498次
文章归档
最新评论