inc.asp

来自「网络商城SxShop3.0版」· ASP 代码 · 共 68 行

ASP
68
字号
<%
Dim Conn
Dim Connstr
Set Conn=server.createobject("ADODB.CONNECTION")
db = "data/count15.mdb"
	connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(""&db&"")
'	connstr="driver={Microsoft Access Driver (*.mdb)};dbq=" & Server.MapPath(""&db&"")
'	connstr="driver={SQL Server};server=localhost;UID=sa;PWD=;database=club"
Conn.open Connstr 

Function GetRs(Sql)
	Set Rs = Server.CreateObject("ADODB.Recordset")
	Rs.open Sql,Conn,1,1
	Set GetRs = Rs
End Function

Function Fn_Dir(FilePath)
	for i=1 to len(FilePath)
	if left(right(FilePath,i),1)="/" or left(right(FilePath,i),1)="\" then
	  abc=i
	  exit for
	end if
	next
	if abc <> 1 then
	Fn_Dir=left(FilePath,len(FilePath)-abc+1)
	end if
end Function


function Fn_IP(ip)
	ip=cstr(ip)
	ip1=left(ip,cint(instr(ip,".")-1))
	ip=mid(ip,cint(instr(ip,".")+1))
	ip2=left(ip,cint(instr(ip,".")-1))
	ip=mid(ip,cint(instr(ip,".")+1))
	ip3=left(ip,cint(instr(ip,".")-1))
	ip4=mid(ip,cint(instr(ip,".")+1))
	Fn_IP=cint(ip1)*256*256*256+cint(ip2)*256*256+cint(ip3)*256+cint(ip4)
end function

'转译字符
	Function Fn_EnChar(body)
	'	body = Trim(body)
		body = Replace(body,CHR(38),"&#38;")
		body = replace(body,">","&gt;")
		body = replace(body,"<","&lt;")
		body = Replace(body,Chr(10),"<br>")
		body = Replace(body,Chr(13),"")
		
		body = Replace(body,CHR(34),"&quot;")
		body = Replace(body,CHR(39),"&#39;")
		body = Replace(body,CHR(32),"&nbsp;")
		Fn_EnChar = body
	End Function
'还原字符
	Function Fn_DeChar(body)
		body = replace(body,"&gt;",">")
		body = replace(body,"&lt;","<")
		body = Replace(body,"<br>",Chr(10))
		body = Replace(body,"",Chr(13))
		body = Replace(body,"&nbsp;",CHR(32))
		body = Replace(body,"&quot;",CHR(34))
		body = Replace(body,"&#39;",CHR(39))
		body = Replace(body,"&#38;",CHR(38))
		Fn_DeChar = body
	End Function
'
%>

⌨️ 快捷键说明

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