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

📄 char.asp

📁 这是个考试系统哦 想学的人可以看看哦
💻 ASP
📖 第 1 页 / 共 5 页
字号:
   if instr(lp,mid(badStrs,li,1))<>0 then
    checkRequest=true
    et="包含非法字符"
   end if
  next
 end if
 
 if checkRequest then
  if et<>pr then
   adderrmsg "参数错误:<font color=red>"&pn&"</font>"&et
  else
   adderrmsg et
  end if
 end if
 checkRequest=(not checkRequest)
end function
Rem 记录错误
dim esg(),curErrMsg,maxErrMsg,founderr
founderr=false
maxErrmsg=10
redim esg(maxErrmsg)
curErrMsg=0
function addErrMsg(errmsg)
 founderr=true
 esg(curErrMsg)=errmsg
 if curErrMsg>maxErrmsg then
  curErrMsg=curErrmsg-1
 end if
 curErrMsg=curErrmsg+1
end function

Rem 显示错误
function showErrMsg()
	stats=stats&"-错误:"&esg(0)
	response.write "<style type='text/css'>"
	response.write ".errmsg { width: 100%; text-align: center; border: 1px solid #ccc; border-width: 1px 0; background-color: #DEDEDE; padding: 30px 0; margin-top: 30px; }"
	response.write ".errmsg .et { font-size: 16px; font-weight: bold; padding: 7px 0; }"
	response.write ".errmsg .es { width: 55%; }"
	response.write ".errmsg .es ul { text-align: left; }"
	response.write "</style>"
	response.write "<div class='errmsg'>"
	response.write "<div class='et'>产生以下错误:</div>"
	response.write "<div class='es'><ul>"
	for i=0 to curErrMsg-1
		response.write "<li>"&esg(i)&"</li>"
	next
	response.write "</ul></div>"
	response.write "<div class='bp'><a href='javascript:history.go(-1);'>[返回前页]</a></div"
	response.write "</div>"
	response.end
end function


Rem 显示成功信息
function showSuccMsg(msg)
	response.write "<style type='text/css'>"
	response.write ".succmsg { width: 100%; text-align: center; padding: 30px 0; }"
	response.write ".succmsg .et { font-size: 16px; font-weight: bold; padding: 7px 0; }"
	response.write ".succmsg .es { width: 65%; padding: 10px 0; }"
	response.write ".succmsg .es ul { text-align: left; }"
	response.write ".succmsg .bp a { color: blue; text-decoration: none; }"
	response.write "</style>"
	response.write "<div class='succmsg'>"
	response.write "<div class='et'>操作完成!</div>"
	response.write "<div class='es'>"& msg & "</div>"
	response.write "<div class='bp'><a href='javascript:history.go(-1);'>[返回前页]</a></div"
	response.write "</div>"
	response.end
end function


Rem 显示FLASH
sub showSWF(fn,w,h)
%><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="<%=w%>" height="<%=h%>"><param name="movie" value="<%=fn%>"><param name="quality" value="high"><embed src="<%=fn%>" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="<%=w%>" height="<%=h%>"></embed></object><%
end sub
%>
<%
function n2e(str)
 if isNull(str) then n2e="" else n2e=str
end function

Rem 转为正常显示结果
function inValue(str)
inValue=str
inValue=replace(n2e(inValue),"""","\""")
inValue=replace(n2e(inValue),"</","<""+""/")
inValue=replace(n2e(inValue),vbCRLF,"\n")
inValue=replace(n2e(inValue),chr(13)&chr(10),"\n")
inValue=replace(n2e(inValue),chr(10)&chr(13),"\n")
inValue=replace(n2e(inValue),chr(10),"\n")
inValue=replace(n2e(inValue),chr(13),"\n")
inValue=replace(n2e(inValue),"t:","t:")
inValue=replace(n2e(inValue),"T:","t:")
end function

Rem 转为HTML代码
function inHTML(str)
inHTML=str
inHTML = Replace(n2e(inHTML), CHR(32), "&nbsp;")
inHTML = Replace(n2e(inHTML), CHR(9), "&nbsp;")
inHTML = Replace(n2e(inHTML), CHR(34), "&quot;")
inHTML = Replace(n2e(inHTML), CHR(39), "&#39;")
inHTML=replace(n2e(inHTML),"<","&lt;")
inHTML=replace(n2e(inHTML),">","&gt;")
inHTML=replace(n2e(inHTML)," ","&nbsp;")
inHTML=replace(n2e(inHTML),vbCRLF,"<BR>")
inHTML=replace(n2e(inHTML),chr(13)&chr(10),"<BR>")
inHTML=replace(n2e(inHTML),chr(10)&chr(13),"<BR>")
inHTML=replace(n2e(inHTML),chr(10),"<BR>")
inHTML=replace(n2e(inHTML),chr(13),"<BR>")
end function

Rem 显示浏览器版本
function browser(info)
    if Instr(info,"MSIE 5.5")>0 then
        browser="浏 览 器:Internet Explorer 5.5"
    elseif Instr(info,"MSIE 6.0")>0 then
        browser="浏 览 器:Internet Explorer 6.0"
    elseif Instr(info,"MSIE 5.01")>0 then
        browser="浏 览 器:Internet Explorer 5.01"
    elseif Instr(info,"MSIE 5.0")>0 then
        browser="浏 览 器:Internet Explorer 5.00"
    elseif Instr(info,"MSIE 4.0")>0 then
        browser="浏 览 器:Internet Explorer 4.01"
    else
        browser="浏 览 器:未知"
    end if
end function

Rem 显示操作系统
function system(info)
    if Instr(info,"NT 5")>0 then
        system=system+"操作系统:Windows 2000"
    elseif Instr(info,"NT 4")>0 then
        system=system+"操作系统:Windows NT4"
    elseif Instr(info,"98")>0 then
        system=system+"操作系统:Windows 98"
    elseif Instr(info,"95")>0 then
        system=system+"操作系统:Windows 95"
    else
        system=system+"操作系统:未知"
    end if
end function

Rem 检查OICQ号码
Function chkoicq(oicq)
    Dim re1
    Set re1 = new RegExp
    re1.IgnoreCase = false
    re1.global = false
    re1.Pattern = "[0-9]{4,9}$"
    chkoicq = re1.Test(oicq)
End Function

Rem 将日期转换为一串数字

⌨️ 快捷键说明

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