📄 fuction.asp
字号:
<%
'模糊视线
'2003.10.31
Rem 过滤SQL非法字符
function checkFFSQLStr(str)
if isnull(str) then
checkFFSQLStr = ""
exit function
end if
str=replace(str," ","")
str=replace(str,";","")
str=replace(str,"'","''")
checkFFSQLStr=str
end function
Rem 判断数字是否整形
function isChkInteger(para)
on error resume next
dim str
dim l,i
if isNUll(para) then
isChkInteger=false
exit function
end if
str=cstr(para)
if trim(str)="" then
isChkInteger=false
exit function
end if
l=len(str)
for i=1 to l
if mid(str,i,1)>"9" or mid(str,i,1)<"0" then
isChkInteger=false
exit function
end if
next
isChkInteger=true
if err.number<>0 then err.clear
end function
function cutStr(str,strlen)
dim l,t,c
l=len(str)
t=0
for i=1 to l
c=Abs(Asc(Mid(str,i,1)))
if c>255 then
t=t+2
else
t=t+1
end if
if t>=strlen then
cutStr=left(str,i)&".."
exit for
else
cutStr=str
end if
next
cutStr=replace(cutStr,chr(10),"")
end function
function tohtml(byval str1)
tempstr=str1
tempstr=replace(tempstr,"<br>"," ")
tempstr=replace(tempstr,"&","&")
tempstr=replace(tempstr,">",">")
tempstr=replace(tempstr,"<","<")
tohtml=tempstr
end function
function htmltotext(byval nr)
''过滤html字符的
pa=""
strContent=nr
Set regex = New RegExp
regEx.Global = True
regEx.IgnoreCase = False ' 设置是否区分大小写。<BR>
'去掉换行
regEx.Pattern = "\n"
strContent = regEx.Replace(strContent,"")
regEx.Pattern = "<[a-zA-Z]+([ ]|[^\n>]|[%$#@!'])*>"
strContent = regEx.Replace(strContent,"")
regEx.Pattern = "</[a-zA-Z]+>"
strContent = regEx.Replace(strContent,"")
regEx.Pattern = "[ ]+"
strContent = regEx.Replace(strContent," ")
strContent=replace(strContent," ","")
if len(strContent)>1000 then
strContent=left(strContent,1000) & "......"
end if
htmltotext=strContent
end function
function HTMLEncode2(fString)
fString = Replace(fString, CHR(13), "")
fString = Replace(fString, CHR(10) & CHR(10), "</P><P>")
fString = Replace(fString, CHR(10), "<BR>")
HTMLEncode2 = fString
end function
'模糊视线增加于2005.11.4,QQ:9912515
function nosql(str)
if not isnull(str) then
str=trim(str)
str=replace(str,";",";") '分号
str=replace(str,"'","'") '单引号
str=replace(str,"""",""") '双引号
str=replace(str,"chr(9)"," ") '空格
str=replace(str,"chr(10)","<br>") '回车
str=replace(str,"chr(13)","<br>") '回车
str=replace(str,"chr(32)"," ") '空格
str=replace(str,"chr(34)",""") '双引号
str=replace(str,"chr(39)","'") '单引号
str=Replace(str, "script", "script")'jscript
str=replace(str,"<","<") '左<
str=replace(str,">",">") '右>
str=replace(str,"(","(") '左(
str=replace(str,")",")") '右)
str=replace(str,"--","--") 'SQL注释符
nosql=str
end if
end function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -