📄 customfunc.asp
字号:
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<%
'*****************************
'功能:转换输入文本中的回车和空格
'调用方法:convert(输入字符串)
'返回值:字符
'开发者:王国辉
'创建时间:2005-10-13 11:19
'*****************************
function convert(str)
if str<>"" then
str=replace(str,chr(13),"<br>")
str=replace(str,chr(32)," ")
end if
convert=str
end function
'*****************************
'功能:关闭记录集
'调用方法:closeRS(记录集名称)
'开发者:王国辉
'创建时间:2005-10-13 16:13
'*****************************
function closeRS(rsName)
rsName.close
set rsName=nothing
end function
'*****************************
'功能:关闭数据库连接
'调用方法:closeConn(连接名称)
'开发者:王国辉
'创建时间:2005-10-13 16:15
'*****************************
function closeConn(connName)
connName.close
set connName=nothing
end function
'*****************************
'功能:弹出提示对话框并重定向网页
'调用方法:message "提示内容","重定向网页的url地址"
'开发者:王国辉
'创建时间:2005-10-14 08:17
'*****************************
function message(content,url)
response.Write("<script language='javascript'>alert('"&content&"');window.location.href='"&url&"';</script>")
response.End()
end function
'*****************************
'功能:打开指定大小的新窗口并设置窗口居中显示
'调用方法:call openwin(url,width,height)
'开发者:王国辉
'创建时间:2005-10-14 09:42
'说明:如果w的值为0,则新窗口尺寸不做控制
'*****************************
function openwin(url,w,h,no)
response.Write("<script language='javascript'>function openwin"&no&"(){")
response.Write("if ("&w&"=='0'){var winhdc=window.open('"&url&"');")
response.Write( "var width=0;var height=0;}else{")
response.Write("var winhdc=window.open('"&url&"','','width="&w&",height="&h&"');")
response.Write("var width=(screen.width-"&w&")/2;")
response.Write("var height=(screen.height-"&h&")/2;}")
response.Write("winhdc.moveTo(width,height);")
response.Write("}</script>")
end function
function filter_Str(InString)
'***********************************
'功能:过滤输入字符串中的危险符号
'调用方法:filter_Str("String")
'开发时间:2005-07-07 14:12
'开发者:王国辉
'***********************************
NewStr=Replace(InString,"'","''")
NewStr=Replace(NewStr,"<","<")
NewStr=Replace(NewStr,">",">")
NewStr=Replace(NewStr,"chr(60)","<")
NewStr=Replace(NewStr,"chr(37)",">")
NewStr=Replace(NewStr,"""",""")
NewStr=Replace(NewStr,";",";;")
NewStr=Replace(NewStr,"--","-")
NewStr=Replace(NewStr,"/*"," ")
NewStr=Replace(NewStr,"%"," ")
filter_Str=NewStr
end function
'***********************************
'功能:身份验证
'调用方法:变量=Login("用户名","密码","表名","用户名字段名","密码字段名")
'开发时间:2005-10-22 08:17
'开发者:王国辉
'***********************************
function Login(username,PWD,tablename,F_user,F_PWD)
username=filter_Str(username)
if username<>"" then
PWD=filter_Str(PWD)
sql="select * from "&tablename&" where "&F_user&"='"&username&"'"
set rs=conn.execute(sql)
if rs.eof then
Login=false
else
if rs(F_PWD)=PWD then
Login=true
else
Login=false
end if
end if
else
Login=null
end if
end function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -