📄 function.asp
字号:
<%
function formatStr(str)
if isnull(str) then
exit function
end if
str=trim(str)
str=replace(str,"<","<")
str=replace(str,">",">")
str=replace(str,"'","")
str=Replace(str,"""",""")
str=replace(str,"and","")
str=replace(str,vbCrLf&vbCrlf,"</p><p>")
str=replace(str,vbCrLf,"<br/>")
str=Replace(str,"&#","&#")
str=replace(str,"javascript","/javascript")
str=replace(str,"cookie","/cookie")
str=replace(str,"document","/document")
formatStr=str
end function
function check_alert(a,b)
response.write "<script language='javascript'>" & VbCRlf
response.write "alert('"&a&"');" & VbCrlf
response.write "location.href='"&b&"'" & vbCrlf
response.write "</script>" & VbCRLF
response.end
end function
function Get_TableName(id,table,Ziduan,indexid)
set rs_Dep=server.CreateObject("adodb.recordset")
rs_Dep.open "select * from "&table&" where "&indexid&"="&id,conn,1,1
if not rs_Dep.eof then
Get_TableName=rs_Dep(Ziduan)
else
exit function
end if
rs_Dep.close
set rs_Dep=nothing
end function
function nohtml(str)
dim re
Set re=new RegExp
re.IgnoreCase =true
re.Global=True
re.Pattern="(\<.[^\<]*\>)"
str=re.replace(str," ")
re.Pattern="(\<\/[^\<]*\>)"
str=re.replace(str," ")
nohtml=str
set re=nothing
end function
Function gen_key(digits)
'Create and define array
dim char_array(50)
char_array(0) = "0"
char_array(1) = "1"
char_array(2) = "2"
char_array(3) = "3"
char_array(4) = "4"
char_array(5) = "5"
char_array(6) = "6"
char_array(7) = "7"
char_array(8) = "8"
char_array(9) = "9"
char_array(10) = "A"
char_array(11) = "B"
char_array(12) = "C"
char_array(13) = "D"
char_array(14) = "E"
char_array(15) = "F"
char_array(16) = "G"
char_array(17) = "H"
char_array(18) = "I"
char_array(19) = "J"
char_array(20) = "K"
char_array(21) = "L"
char_array(22) = "M"
char_array(23) = "N"
char_array(24) = "O"
char_array(25) = "P"
char_array(26) = "Q"
char_array(27) = "R"
char_array(28) = "S"
char_array(29) = "T"
char_array(30) = "U"
char_array(31) = "V"
char_array(32) = "W"
char_array(33) = "X"
char_array(34) = "Y"
char_array(35) = "Z"
'Initiate randomize method for default seeding
randomize
'Loop through and create the output based on the the variable passed to
'the function for the length of the key.
do while len(output) < digits
num = char_array(Int((35 - 0 + 1) * Rnd + 0))
output = output + num
loop
'Set return
gen_key = output
End Function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -