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

📄 char.asp

📁 商品订单管理:商品分类管理 添加与修改商品 管理订单 投诉订单 反馈信息 商品留言管理 管理网站用户:管理用户 管理后台管理员 新闻公告管理:新闻添加(支持图片新闻) 修改删除 首页公告设置 网站常规
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<%
''''''''''''''''''''''''''''''''''''''''''
function HTMLEncode(fString)
if not isnull(fString) then
    fString = replace(fString, ">", "&gt;")
    fString = replace(fString, "<", "&lt;")
    fString = Replace(fString, CHR(32), "&nbsp;")
    fString = Replace(fString, CHR(9), "&nbsp;")
    fString = Replace(fString, CHR(34), "&quot;")
    fString = Replace(fString, CHR(39), "&#39;")
    fString = Replace(fString, CHR(13), "")
    fString = Replace(fString, CHR(10) & CHR(10), "</P><P> ")
    fString = Replace(fString, CHR(10), "<BR> ")
    HTMLEncode = fString
end if
end function
''''''''''''''''''''''''''''''''''''''''''
function checkStr(str)
	if isnull(str) then
		checkStr = ""
		exit function 
	end if
	checkStr=replace(str,"'","’")
end function
''''''''''''''''''''''''''''''''''''''''''
Function checkHTML(ByVal strMessageInput)
Dim strTempHTMLMessage,lngMessagePosition,intHTMLTagLength,strHTMLMessage,strTempMessageInput
strTempMessageInput = strMessageInput
For lngMessagePosition = 1 to CLng((Len(strMessageInput)))
If Mid(strMessageInput, lngMessagePosition, 1) = "" Then Exit For
If Mid(strMessageInput, lngMessagePosition, 1) = "<" Then
intHTMLTagLength = (InStr(lngMessagePosition, strMessageInput, ">", 1) - lngMessagePosition)
strHTMLMessage = Mid(strMessageInput, lngMessagePosition, intHTMLTagLength + 1)
strTempHTMLMessage = strHTMLMessage
If InStr(1, strTempHTMLMessage, "href", 1) <> 0 Then
strTempHTMLMessage = Replace(strTempHTMLMessage, "<", "**/**", 1, -1, 1)
strTempHTMLMessage = Replace(strTempHTMLMessage, ">", "**\**", 1, -1, 1)
strTempHTMLMessage = formatLink(strTempHTMLMessage)
strTempHTMLMessage = Replace(strTempHTMLMessage, "**/**", "<", 1, -1, 1)
strTempHTMLMessage = Replace(strTempHTMLMessage, "**\**", ">", 1, -1, 1)
strTempHTMLMessage = Replace(strTempHTMLMessage, ">", " target=""_blank"">", 1, -1, 1)
End If
If InStr(1, strTempHTMLMessage, "img", 1) <> 0 Then
strTempHTMLMessage = Replace(strTempHTMLMessage, "<", "**/**", 1, -1, 1)
strTempHTMLMessage = Replace(strTempHTMLMessage, ">", "**\**", 1, -1, 1)
strTempHTMLMessage = Replace(strTempHTMLMessage, "**/**", "<", 1, -1, 1)
strTempHTMLMessage = Replace(strTempHTMLMessage, "**\**", ">", 1, -1, 1)
strTempHTMLMessage = Replace(strTempHTMLMessage, ">", " border=""0"">", 1, -1, 1)
End If
If InStr(1, strTempHTMLMessage, "href", 1) = 0 AND InStr(1, strTempHTMLMessage, "img", 1) = 0 Then
                strTempHTMLMessage = Replace(strTempHTMLMessage, "html", "", 1, -1, 1)
				strTempHTMLMessage = Replace(strTempHTMLMessage, "body", "", 1, -1, 1)
				strTempHTMLMessage = Replace(strTempHTMLMessage, "head", "", 1, -1, 1)
				strTempHTMLMessage = Replace(strTempHTMLMessage, "meta", "", 1, -1, 1)
				strTempHTMLMessage = Replace(strTempHTMLMessage, "button", "", 1, -1, 1)
				strTempHTMLMessage = Replace(strTempHTMLMessage, "input", "", 1, -1, 1)
				strTempHTMLMessage = Replace(strTempHTMLMessage, "type", "", 1, -1, 1)
				strTempHTMLMessage = Replace(strTempHTMLMessage, "select", "", 1, -1, 1)
				strTempHTMLMessage = Replace(strTempHTMLMessage, "radio", "", 1, -1, 1)
				strTempHTMLMessage = Replace(strTempHTMLMessage, "file", "", 1, -1, 1)
				strTempHTMLMessage = Replace(strTempHTMLMessage, "hidden", "", 1, -1, 1)
				strTempHTMLMessage = Replace(strTempHTMLMessage, "checkbox", "", 1, -1, 1)
				strTempHTMLMessage = Replace(strTempHTMLMessage, "password", "", 1, -1, 1)
				strTempHTMLMessage = Replace(strTempHTMLMessage, "blink", "", 1, -1, 1)
				strTempHTMLMessage = Replace(strTempHTMLMessage, "fieldset", "", 1, -1, 1)
				strTempHTMLMessage = Replace(strTempHTMLMessage, "javascript", "", 1, -1, 1)
				strTempHTMLMessage = Replace(strTempHTMLMessage, "vbscript", "", 1, -1, 1)
				strTempHTMLMessage = Replace(strTempHTMLMessage, "script", "", 1, -1, 1)
				strTempHTMLMessage = Replace(strTempHTMLMessage, "object", "", 1, -1, 1)
				strTempHTMLMessage = Replace(strTempHTMLMessage, "applet", "", 1, -1, 1)
				strTempHTMLMessage = Replace(strTempHTMLMessage, "embed", "", 1, -1, 1)
				strTempHTMLMessage = Replace(strTempHTMLMessage, "event", "", 1, -1, 1)
				strTempHTMLMessage = Replace(strTempHTMLMessage, "server", "", 1, -1, 1)
				strTempHTMLMessage = Replace(strTempHTMLMessage, "function", "", 1, -1, 1)
				strTempHTMLMessage = Replace(strTempHTMLMessage, "document", "", 1, -1, 1)
				strTempHTMLMessage = Replace(strTempHTMLMessage, "cookie", "", 1, -1, 1)
				strTempHTMLMessage = Replace(strTempHTMLMessage, "onclick", "", 1, -1, 1)
				strTempHTMLMessage = Replace(strTempHTMLMessage, "ondblclick", "", 1, -1, 1)
				strTempHTMLMessage = Replace(strTempHTMLMessage, "onkey", "", 1, -1, 1)
				strTempHTMLMessage = Replace(strTempHTMLMessage, "onmouse", "", 1, -1, 1)
				strTempHTMLMessage = Replace(strTempHTMLMessage, "onchange", "", 1, -1, 1)
				strTempHTMLMessage = Replace(strTempHTMLMessage, "accesskey", "", 1, -1, 1)
				strTempHTMLMessage = Replace(strTempHTMLMessage, "tabindex", "", 1, -1, 1)
				strTempHTMLMessage = Replace(strTempHTMLMessage, "onfocus", "", 1, -1, 1)
				strTempHTMLMessage = Replace(strTempHTMLMessage, "onblur", "", 1, -1, 1)
				strTempHTMLMessage = Replace(strTempHTMLMessage, "onsubmit", "", 1, -1, 1)
				strTempHTMLMessage = Replace(strTempHTMLMessage, "onreset", "", 1, -1, 1)
				strTempHTMLMessage = Replace(strTempHTMLMessage, "form", "", 1, -1, 1)
				strTempHTMLMessage = Replace(strTempHTMLMessage, "iframe", "", 1, -1, 1)
				strTempHTMLMessage = Replace(strTempHTMLMessage, "textarea", "", 1, -1, 1)
				strTempHTMLMessage = Replace(strTempHTMLMessage, "action", "", 1, -1, 1)
				strTempHTMLMessage = Replace(strTempHTMLMessage, "enctype", "", 1, -1, 1)
				strTempHTMLMessage = Replace(strTempHTMLMessage, "layer", "", 1, -1, 1)
				strTempHTMLMessage = Replace(strTempHTMLMessage, "multicol", "", 1, -1, 1)
				strTempHTMLMessage = Replace(strTempHTMLMessage, "frameset", "", 1, -1, 1)
				strTempHTMLMessage = Replace(strTempHTMLMessage, "marquee", "", 1, -1, 1)
End If
strTempHTMLMessage = formatInput(strTempHTMLMessage)
strTempMessageInput = Replace(strTempMessageInput, strHTMLMessage, strTempHTMLMessage, 1, -1, 1)
End If
Next
checkHTML = strTempMessageInput
End Function
''''''''''''''''''''''''''''''''''''''''''
Function formatInput(ByVal strInputEntry)
    strInputEntry = Replace(strInputEntry, "script", "&#115;cript", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "SCRIPT", "&#083;CRIPT", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "Script", "&#083;cript", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "script", "&#083;cript", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "object", "&#111;bject", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "OBJECT", "&#079;BJECT", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "Object", "&#079;bject", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "object", "&#079;bject", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "applet", "&#097;pplet", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "APPLET", "&#065;PPLET", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "Applet", "&#065;pplet", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "applet", "&#065;pplet", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "embed", "&#101;mbed", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "EMBED", "&#069;MBED", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "Embed", "&#069;mbed", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "embed", "&#069;mbed", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "event", "&#101;vent", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "EVENT", "&#069;VENT", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "Event", "&#069;vent", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "event", "&#069;vent", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "document", "&#100;ocument", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "DOCUMENT", "&#068;OCUMENT", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "Document", "&#068;ocument", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "document", "&#068;ocument", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "cookie", "&#099;ookie", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "COOKIE", "&#067;OOKIE", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "Cookie", "&#067;ookie", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "cookie", "&#067;ookie", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "form", "&#102;orm", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "FORM", "&#070;ORM", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "Form", "&#070;orm", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "form", "&#070;orm", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "iframe", "i&#102;rame", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "IFRAME", "I&#070;RAME", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "Iframe", "I&#102;rame", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "iframe", "i&#102;rame", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "textarea", "&#116;extarea", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "TEXTAREA", "&#84;EXTAREA", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "Textarea", "&#84;extarea", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "textarea", "&#84;extarea", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "on", "&#111;n", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "ON", "&#079;N", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "On", "&#079;n", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "on", "&#111;n", 1, -1, 1)
    strInputEntry = Replace(strInputEntry, "<STR&#079;NG>", "<strong>", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "<str&#111;ng>", "<strong>", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "</STR&#079;NG>", "</strong>", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "</str&#111;ng>", "</strong>", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "f&#111;nt", "font", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "F&#079;NT", "FONT", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "F&#111;nt", "Font", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "f&#079;nt", "font", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "f&#111;nt", "font", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "m&#111;no", "mono", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "M&#079;NO", "MONO", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "M&#079;no", "Mono", 1, -1, 0)

⌨️ 快捷键说明

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