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

📄 inc.asp

📁 数据库设计2.页面的设计与开发3.小结第8章在线考试系统 161 实例分析 161 1. 系统设计2.系统功能预览知识要点 167 制作步骤 168 1 ... 利用简单的HTML代码与脚本 融合而成
💻 ASP
字号:
<%
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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -