⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 my_lib.asp

📁 一个不错的个人商务网站的源码
💻 ASP
字号:
<%
sub wurl(keyword,url)
Response.write "<script>alert('"&keyword&"');location.href='"&url&"';</script>"
Response.end
end sub

sub wnourl(keyword)
response.write"<SCRIPT language=JavaScript>alert('"&keyword&"');"
response.write"javascript:history.go(-1)</SCRIPT>"
end sub


sub connclose(Sconn)
Sconn.close
set Sconn=nothing
end sub

sub rsclose(Ars)
Ars.close
set Ars=nothing
end sub


Function my_request(ParaName,ParaType)
Dim ParaValue
ParaValue=Request(ParaName)
If ParaType=1 Then
  If Not isNumeric(ParaValue) Then
response.write "操作失误"
end if
Else
  ParaValue=replace(ParaValue,"'","''")
End if
my_request=ParaValue
End function

Sub CreateAFolder(file)
  Dim fso
  Set fso = CreateObject("Scripting.FileSystemObject")
  Fso.Createfolder(server.mappath(".."& "\"&file))
  Set fso = nothing
End Sub

Sub DeleteAFolder(file)
  Dim fso
  Set fso = CreateObject("Scripting.FileSystemObject")
  Fso.DeleteFolder(server.mappath(".."& "\"&file))
  Set fso = nothing
End Sub

'去除部分html代码
Function leach(str) 
if str<>"" then
	str=replace(replace(replace(replace(replace(str,chr(34),"&quot;"),chr(39),"&#039;"),"<","&lt;"),">","&gt;"),vbCrlf,"<br>")
end if
	leach=str

End function

'-------------------------------------------------------------------
'恢复部分html代码
Function Outleach(str)

		if str<>"" then
		  str=replace(replace(replace(replace(replace(str,"&quot;",chr(34)),"&#039;",chr(39)),"&lt;","<"),"&gt;",">"),"<br>",vbCrlf)
		end if

   Outleach=str
End function

'post过滤sql注入代防范及HTML防护开始
function nosql(str)
if not isnull(str) then
str=trim(str)
str=replace(str,";","&#59;")		'分号
str=replace(str,"'","&#39;")		'单引号
str=replace(str,"""","&quot;")		'双引号
str=replace(str,"chr(9)","&nbsp;")	'空格
str=replace(str,"chr(10)","<br>")	'回车
str=replace(str,"chr(13)","<br>")	'回车
str=replace(str,"chr(32)","&nbsp;")	'空格
str=replace(str,"chr(34)","&quot;")	'双引号
str=replace(str,"chr(39)","&#39;")	'单引号
str=Replace(str, "script", "&#115cript")'jscript
str=replace(str,"<","&lt;")	        '左<
str=replace(str,">","&gt;")	        '右>
str=replace(str,"(","&#40;")	        '左(
str=replace(str,")","&#41;")	        '右)
str=replace(str,"--","&#45;&#45;")	'SQL注释符
nosql=str
end if
end function

sub CloseConn()
	rs.close
	set rs=nothing
	conn.close
	set conn=nothing
end sub


'--------------留言本
function face(strcontent)
dim p
for p=1 to 48
strcontent=replace(strcontent,"[ssort"&p&"]"," <img src=faceimg/"&p&".gif> ")
next
face=strcontent
end function
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -