导航:首页 > 净水问答 > asp搜索过滤

asp搜索过滤

发布时间:2023-02-02 20:27:40

1. ASP中如何过滤指字文字前或指定文字后所有内容呢

可以用正则进行替换,例如以下代码可以替换a及以后的内所有容字符
<%
str="1234agds34.32"
Dim regEx
Set regEx=new RegExp
regEx.pattern="a.*"
regEx.IgnoreCase =false
regEx.Global=True
str=regEx.Replace(str,"00000")
Response.Write "aaa="&str
%>

2. ASP如何过滤数组内重复内容

dim a(4)
a(0)=1
a(1)=1
a(2)=2
a(3)=2
a(4)=3
for n=0 to ubound(a)-1
for s=1 to ubound(a)

if a(s)=a(n) then
a(n)=""

end if
next

next
a_new=filter(a,"")‘把a数组里面是空值的全部删掉,然后重新组合成一个a_new数组。
for n=0 to ubound(a_new)’打印出a_new数组。
response.write a_new(n)&"<br>"

next

说明:a_new是新生成的数组,去掉了a数组里面被清空的那些,重新生成了一个开头角标是0的a_new数组。

3. asp中如何过滤掉特殊字符

user=replace(trim(request.form("uName")),"'","''")
password=replace(trim(request.form("Password")),"'","''")
if instr(user,"%") or instr(user,"#") or instr(user,"?") or instr(user,"|") or instr(user,"'") then
response.write "<script language=javascript>alert('您的姓名含有非法字符!');this.location.href='login.asp';</script>"
response.end
end if

if instr(password,"%") or instr(password,"#") or instr(password,"?") or instr(password,"|") then
response.write "<script language=javascript>alert('您的密码含有非法字符!');this.location.href='login.asp';</script>"
response.end
end if 我自己做的,希望对你有帮助

阅读全文

与asp搜索过滤相关的资料

热点内容
饮水机什么牌的好不好 浏览:306
农村小井水水质过滤器商家卖铺 浏览:353
环氧树脂放热峰 浏览:491
污水管网沟槽开挖高程换算发 浏览:546
锅炉水处理记录本 浏览:888
机油滤芯上面的胶圈是什么材料 浏览:652
纯水管路用什么材质 浏览:917
废水处理国内研究现状 浏览:806
饮水机磁卡消磁怎么修复 浏览:638
白醋除饮水机水垢的方法 浏览:669
单个净水器滤芯怎么拆卸视频教程 浏览:802
娃哈哈纯净水什么时候产 浏览:956
纯净水和纯水在化学中有什么区别 浏览:240
安吉尔纯水机缺水什么原因 浏览:911
芒硝回乳怎么用 浏览:525
净化器清洗怎么收费 浏览:981
什么空气净化器能净化药味 浏览:917
福特致胜空调滤芯在什么地方 浏览:609
纯水ro膜什么情况要清洗 浏览:273
陶氏ro膜的优缺点 浏览:864