asp 过滤
来源:互联网 发布:什么软件剪辑视频 编辑:程序博客网 时间:2024/05/02 04:34
asp 过滤非法字符函数
<%
Function cutbadchar(str)
badstr="不|文|明|字|符|列|表|格|式"
badword=split(badstr,"|")
For i=0 to Ubound(badword)
If instr(str,badword(i)) > 0 then
str=Replace(str,badword(i),"***")
End If
Next
cutbadchar=str
End Function
Response.Write cutbadchar("中国不阿斗发射点发明")
%>
asp去掉html中的table代码函数
'去掉html中的table代码
Function OutTable(str)
dim a,re
set re=new RegExp
re.pattern="/<[^>]+()/>"
re.global=true
a=str
OutTable=re.replace(a,"")
End Function
asp去掉html,保留img br p div的代码
'去掉html中的table代码
Function OutTable(str)
dim a,re
set re=new RegExp
re.pattern="<(?!img|br|p|div).*?>"
re.global=true
a=str
OutTable=re.replace(a,"")
End Function
ASP中字符串转换成ASCII码
函数
function strToAsc(strValue)
dim strTemp
dim i
strTemp=""
for i=1 to len(strValue & "")
strTemp=strTemp & asc(mid(strValue,i,1))
next
strToAsc=strTemp
end function
JavaScript密码强度在线检测函数
<script language=javascript>
function CharMode(iN){
if (iN>=48 && iN <=57) //数字
return 1;
if (iN>=65 && iN <=90) //大写字母
return 2;
if (iN>=97 && iN <=122) //小写
return 4;
else
return 8; //特殊字符
}
function bitTotal(num){
modes=0;
for (i=0;i<4;i++){
if (num & 1) modes++;
num>>>=1;
}
return modes;
}
function checkStrong(sPW){
if (sPW.length<=4)
return 0; //密码太短
Modes=0;
for (i=0;i<sPW.length;i++){
Modes|=CharMode(sPW.charCodeAt(i));
}
return bitTotal(Modes);
}
function pwStrength(pwd){
O_color="#eeeeee";
L_color="#FF0000";
M_color="#FF9900";
H_color="#33CC00";
if (pwd==null||pwd==''){
Lcolor=Mcolor=Hcolor=O_color;
}
else{
S_level=checkStrong(pwd);
switch(S_level) {
case 0:
Lcolor=Mcolor=Hcolor=O_color;
case 1:
Lcolor=L_color;
Mcolor=Hcolor=O_color;
break;
case 2:
Lcolor=Mcolor=M_color;
Hcolor=O_color;
break;
default:
Lcolor=Mcolor=Hcolor=H_color;
}
}
document.getElementById("strength_L").style.background=Lcolor;
document.getElementById("strength_M").style.background=Mcolor;
document.getElementById("strength_H").style.background=Hcolor;
return;
}
</script><table width="770" border="0" align="center" cellpadding="5" cellspacing="0">
<form name="form1" method="post" onSubmit="return checkform(form1);" action="register_add_ok.aspx?url=" autocomplete="off">
<tr>
<td>登录密码:</td>
<td><input name="login_passwd" onKeyUp=pwStrength(this.value) onBlur=pwStrength(this.value) type="password" id="login_passwd" size="25" maxlength="50">
*(长度在5-50之间,建议密码强度为中以上)</td>
</tr>
Asp检测字符串是否为纯字母和数字组合函数
'******************************
'函数:CheckString(strng)
'参数:strng,待验证字符串
'描述:检测字符串是否为纯字母和数字组合
'示例:<%=CheckString(strng)%>
'******************************
Function CheckString(strng)
CheckString = true
Dim regEx, Match
Set regEx = New RegExp
regEx.Pattern = "^[A-Za-z0-9]+$"
regEx.IgnoreCase = True
Set Match = regEx.Execute(strng)
if match.count then CheckString= false
End Function
- asp 过滤
- ASP特殊字符过滤
- ASP 字符过滤操作
- ASP特殊字符过滤
- asp过滤非法字符
- Asp过滤Html代码
- asp过滤html语言
- ASP 过滤 HTML 标签
- ASP过滤特殊字符
- ASP过滤不文明字符
- ASP过滤HTML字符
- ASP过滤HTML标记
- ASP过滤样式标签
- asp.net关键字过滤
- asp.net 过滤html
- asp注入过滤
- asp过滤SQL注入
- asp.net过滤HTML字符
- 转载:验证微软数字签名 (VC6下用loadlibry等导入相关函数)
- Eclipse开发rap的简单例子
- Create Function简单例子
- 关于java的序列化
- login控件 登陆图片居右显示 登陆窗口不管分辨率,窗口如何变化,一直居中显示
- asp 过滤
- 个人经验总结:在Oracle中恢复被DROP掉的表
- Python中的字符串处理
- passive-interface 在eigrp 和 rip 中的作用一样吗?
- Long与double操作并不是原子的
- 16种适合做生意赚大钱的人
- 外链接
- 省份城市二级连动
- 距★★★★万分