📄 outcheck.asp
字号:
<%
'输出检测,按原格式输出
sub showBody(Str)
dim dist
dim i
for i = 1 to len(str)
if mid(str,i,1)<>"%" and ucase(mid(str,i,6))<>"SCRIPT" then
if mid(str,i,1)<>chr(13) and mid(str,i,1)<>" " then
dist=dist+mid(str,i,1)
elseif mid(str,i,1)=" " or mid(str,i,1)=" " then
response.write dist
response.write " "
dist=""
else
response.write dist
response.write "<BR>"+chr(13)+chr(10)
dist=""
end if
end if
next
response.write dist
end sub
function ShowBody_active(str)
Dim sOut
sOut=str
sOut=replace(sOut," "," ")
sOut=replace(sOut,Chr(13),"<BR>")
ShowBody_active=sOut
end Function
'输出检测
function checktxt(Str)
dim dist
dim i
dist=""
for i = 1 to len(str)
if mid(str,i,1)<>"%" and mid(str,i,1)<>chr(13) and ucase(mid(str,i,6))<>"SCRIPT" then
dist=dist+mid(str,i,1)
end if
next
checktxt=dist
end function
'输入检测,替换单引号
function constr1(data)
constr1=replace(data,"'","''")
end function
function constr2_wer(data)
constr2_wer=replace(data,"""",""")
end function
function constr3_wer(data)
constr3_wer=replace(data,"""","""""")
end function
'树形结构输出检测
function checktxt_w2(i)
dim j,k,x,h
h=""
k=len(i)
for j=1 to k step 1
x=mid(i,j,1)
if x=chr(39) then
h=h & "+" & chr(34) & chr(39) & chr(34)
elseif x=chr(34) then
h=h & "+" & chr(39) & chr(34) & chr(39)
else
h=h & "+" & chr(34) & x & chr(34)
end if
next
checktxt_w2=h
end function
'对双精度小数前面补零
function checkNo(i)
dim j
j=cstr(i)
if instr(1,j,".")=1 then
checkno="0"&j
else
checkno=j
end if
end function
function outcheckNo(i)
if i<>0 then
outcheckNo=checkno(formatnumber(i,2))
else
outcheckNo=" "
end if
end function
'判断文本输出值是否为空
function outcheckAll(i)
if i<>"" and isnull(i)=false then
outcheckAll=server.HTMLEncode(i)
else
outcheckAll=" "
end if
end function
function outcheckInt(i)
if i<>0 then
outcheckInt=i
else
outcheckInt=" "
end if
end function
'格式化日期
function formatrq1_wer(i)
dim year_rq,month_rq,day_rq
if i <>"" AND NOT ISNULL(i) then
if len(year(i))<4 then
year_rq="20"&year(i)
else
year_rq=year(i)
end if
if len(month(i))<2 then
month_rq="0"&month(i)
else
month_rq=month(i)
end if
if len(day(i))<2 then
day_rq="0"&day(i)
else
day_rq=day(i)
end if
formatrq1_wer=year_rq&"年"&month_rq&"月"&day_rq&"日"
end if
end function
function formatrq2_wer(i)
dim year_rq,month_rq,day_rq
if i <>"" AND NOT ISNULL(i) then
if len(year(i))<4 then
year_rq="20"&year(i)
else
year_rq=year(i)
end if
if len(month(i))<2 then
month_rq="0"&month(i)
else
month_rq=month(i)
end if
if len(day(i))<2 then
day_rq="0"&day(i)
else
day_rq=day(i)
end if
formatrq2_wer=year_rq&"-"&month_rq&"-"&day_rq
end if
end function
function oa_error_wer(i)
Response.Write "<script language='vbscript'>"&chr(13)
Response.Write "msgbox("""&i&""")"&chr(13)
Response.Write "history.back(0)"&chr(13)
Response.Write "</script>"
end function
function oa_error_wer1(i)
Response.Write "<script language='vbscript'>"&chr(13)
Response.Write "msgbox("""&i&""")"&chr(13)
Response.Write "top.window.location.href="&""""&"da_lmgl.asp"&""""&chr(13)
Response.Write "</script>"
end function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -