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

📄 char.asp

📁 单班同学录 一个非常漂亮的同学录 哦
💻 ASP
字号:
<%
'判断EMAIL是否合法
function IsValidEmail(email)
dim names, name, i, c
IsValidEmail = true
names = Split(email, "@")
if UBound(names) <> 1 then
   IsValidEmail = false
   exit function
end if
for each name in names
   if Len(name) <= 0 then
     IsValidEmail = false
     exit function
   end if
   for i = 1 to Len(name)
     c = Lcase(Mid(name, i, 1))
     if InStr("abcdefghijklmnopqrstuvwxyz_-.", c) <= 0 and not IsNumeric(c) then
       IsValidEmail = false
       exit function
     end if
   next
   if Left(name, 1) = "." or Right(name, 1) = "." then
      IsValidEmail = false
      exit function
   end if
next
if InStr(names(1), ".") <= 0 then
   IsValidEmail = false
   exit function
end if
i = Len(names(1)) - InStrRev(names(1), ".")
if i <> 2 and i <> 3 then
   IsValidEmail = false
   exit function
end if
if InStr(email, "..") > 0 then
   IsValidEmail = false
end if

end function
'判断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

'判断发言是否来自外部
function ChkPost()
	dim server_v1,server_v2
	chkpost=false
	server_v1=Cstr(Request.ServerVariables("HTTP_REFERER"))
	server_v2=Cstr(Request.ServerVariables("SERVER_NAME"))
	if mid(server_v1,8,len(server_v2))<>server_v2 then
		chkpost=false
	else
		chkpost=true
	end if
end function

'分页
Sub LastNextPage(pagecount,page,resultcount)
	Dim query, a, x, temp
	action = "http://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("SCRIPT_NAME")

	query = Split(Request.ServerVariables("QUERY_STRING"), "&")
	For Each x In query
	    a = Split(x, "=")
	    If StrComp(a(0), "page", vbTextCompare) <> 0 Then
	        temp = temp & a(0) & "=" & a(1) & "&"
	    End If
	Next

	Response.Write("<table cellspacing=0 cellpadding=0 border=0>" & vbCrLf )		
	Response.Write("<form method=get onsubmit=""document.location = '" & action & "?" & temp & "Page='+ this.page.value;return false;""><TR>" & vbCrLf )
	Response.Write("<TD align=right>" & vbCrLf )
'	Response.Write(font_style & vbCrLf )	
		
	if page<=1 then
		Response.Write ("首页 " & vbCrLf)		
		Response.Write ("上一页 " & vbCrLf)
	else		
		Response.Write("<A HREF=" & action & "?" & temp & "Page=1>首页</A> " & vbCrLf)
		Response.Write("<A HREF=" & action & "?" & temp & "Page=" & (Page-1) & ">上一页</A> " & vbCrLf)
	end if

	if page>=pagecount then
		Response.Write ("下一页 " & vbCrLf)
		Response.Write ("尾页" & vbCrLf)			
	else
		Response.Write("<A HREF=" & action & "?" & temp & "Page=" & (Page+1) & ">下一页</A> " & vbCrLf)
		Response.Write("<A HREF=" & action & "?" & temp & "Page=" & pagecount & ">尾页</A>" & vbCrLf)			
	end if
		
	Response.Write(" 第" & "<INPUT style=""HEIGHT: 19px;font-size: 12px""TYEP=TEXT NAME=page SIZE=2 Maxlength=4 VALUE=" & page & ">" & "页"  & vbCrLf & "<INPUT type=submit style=""HEIGHT: 19px;font-size: 12px"" value=GO>")
	Response.Write(" 共 " & pageCount & " 页" &  vbCrLf)			
	Response.Write(" " & resultcount & " 条信息" &  vbCrLf)			
	Response.Write("</TD>" & vbCrLf )				
	Response.Write("</TR></form>" & vbCrLf )		
	Response.Write("</table>" & vbCrLf )		
End Sub

'浏览器、操作系统版本侦测
function browser(text)
	if Instr(text,"MSIE 5.5")>0 then
		browser="IE 5.5"
	elseif Instr(text,"MSIE 6.0")>0 then
		browser="IE 6.0"
	elseif Instr(text,"MSIE 5.01")>0 then
		browser="IE 5.01"
	elseif Instr(text,"MSIE 5.0")>0 then
		browser="IE 5.00"
	elseif Instr(text,"MSIE 4.0")>0 then
		browser="IE 4.01"
		else
		browser="未知"
	end if
end function

function system(text)
	if Instr(text,"NT 5.1")>0 then
		system=system+"Windows XP"
	elseif Instr(text,"NT 5")>0 then
		system=system+"Windows 2000"
	elseif Instr(text,"NT 4")>0 then
		system=system+"Windows NT4"
	elseif Instr(text,"4.9")>0 then
		system=system+"Windows ME"
	elseif Instr(text,"98")>0 then
		system=system+"Windows 98"
	elseif Instr(text,"95")>0 then
		system=system+"Windows 95"
		else
		system=system+"未知"
	end if
end function


Rem 过滤HTML代码
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 HTMLDecode(fString)

    fString = replace(fString, "&gt;", ">")
    fString = replace(fString, "&lt;", "<")
	fString = Replace(fString, "&nbsp;",CHR(32))
    fString = Replace(fString, "&nbsp;",CHR(9))
    fString = Replace(fString, "&quot;",CHR(34))
    fString = Replace(fString, "&#39;",CHR(39))
    fString = Replace(fString, "", CHR(13))
    fString = Replace(fString, "</P><P> ",CHR(10) & CHR(10))
    fString = Replace(fString, "<BR>", CHR(10))
    HTMLDecode = fString
end function

function UBBCode(strContent)
	set re = New RegExp	
	re.Global = True
	re.IgnoreCase = True

    're.Pattern="(\[IMG\])(.[^\[]*)(\[\/IMG\])"
    'strContent=re.Replace(strContent,"<IMG SRC=""$2"" border=0> ")
	re.Pattern="\[em(.[^\[]*)\]"
	strContent=re.Replace(strContent,"<img src=face/$1.gif border=0>")

	
	re.Pattern = "\[url=(.[^\]]*)\](.[^\[]*)\[\/url]"
	strContent = re.Replace(strContent,"<a target=_blank href=$1>$2</a>")
	re.Pattern = "\[url](.[^\[]*)\[\/url]"
	strContent = re.Replace(strContent,"<a target=_blank href=$1>$1</a>")
	re.Pattern = "^(http://[A-Za-z0-9\./=\?%\-&_~`@':+!]+)"
	strContent = re.Replace(strContent,"<a target=_blank href=$1>$1</a>")
	re.Pattern = "(http://[A-Za-z0-9\./=\?%\-&_~`@':+!]+)$"
	strContent = re.Replace(strContent,"<a target=_blank href=$1>$1</a>")
	re.Pattern = "([^>=""])(http://[A-Za-z0-9\./=\?%\-&_~`@':+!]+)"
	strContent = re.Replace(strContent,"$1<a target=_blank href=$2>$2</a>")
	re.Pattern = "^(ftp://[A-Za-z0-9\./=\?%\-&_~`@':+!]+)"
	strContent = re.Replace(strContent,"<a target=_blank href=$1>$1</a>")

   

    	re.Pattern="\[HTML](.[^\[]*)\[\/HTML]"
    	strContent=re.Replace(strContent,"<SPAN><IMG src=pic/code.gif align=absBottom> HTML 代码片段如下:<BR><TEXTAREA style=""WIDTH: 94%; BACKGROUND-COLOR: #f7f7f7"" name=textfield rows=10>$1</TEXTAREA><BR><INPUT onclick=runEx() type=button value=运行此代码 name=Button> [Ctrl+A 全部选择   提示:你可先修改部分代码,再按运行]</SPAN><BR>")
    	re.Pattern="\[COLOR=(.[^\]]*)\](.[^\[]*)\[\/COLOR]"
    	strContent=re.Replace(strContent,"<font color=$1>$2</font>")
    	re.Pattern="\[FACE=(.[^\]]*)\](.[^\[]*)\[\/FACE]"
    	strContent=re.Replace(strContent,"<font face=$1>$2</font>")
    	re.Pattern="\[ALIGN=(.[^\]]*)\](.[^\[]*)\[\/ALIGN]"
    	strContent=re.Replace(strContent,"<p align=$1>$2</p>")
    '	re.Pattern="\[QUOTE](.[^\[]*)\[\/QUOTE]"
    '	strContent=re.Replace(strContent,"<BLOCKQUOTE><b>引用</b>:<HR>$1<HR></BLOCKQUOTE>")
    	re.Pattern="\[FLY](.[^\[]*)\[\/FLY]"
    	strContent=re.Replace(strContent,"<marquee width=90% behavior=alternate scrollamount=3>$1</marquee>")
    	re.Pattern="\[MOVE](.[^\[]*)\[\/MOVE]"
    	strContent=re.Replace(strContent,"<MARQUEE scrollamount=3>$1</marquee>")
    	re.Pattern="\[GLOW=(.[^\]]*),(.[^\]]*),(.[^\]]*)\](.[^\[]*)\[\/GLOW]"
    	strContent=re.Replace(strContent,"<table width=$1 style=""filter:glow(color=$2, strength=$3)"">$4</table>")
    	re.Pattern="\[SHADOW=(.[^\]]*),(.[^\]]*),(.[^\]]*)\](.[^\[]*)\[\/SHADOW]"
    	strContent=re.Replace(strContent,"<table width=$1 style=""filter:shadow(color=$2, strength=$3)"">$4</table>")

	re.Pattern = "\[b](.[^\[]*)\[\/b]"
	strContent = re.Replace(strContent,"<b>$1</b>")
	re.Pattern = "\[I](.[^\[]*)\[\/I]"
	strContent = re.Replace(strContent,"<I>$1</I>")
	re.Pattern = "\[u](.[^\[]*)\[\/u]"
	strContent = re.Replace(strContent,"<U>$1</U>")

    	re.Pattern ="\[size=1](.[^\[]*)\[\/size]"
    	strContent = re.Replace(strContent,"<font size=1>$1</font>")
    	re.Pattern ="\[size=2](.[^\[]*)\[\/size]"
    	strContent = re.Replace(strContent,"<font size=2>$1</font>")
    	re.Pattern ="\[size=3](.[^\[]*)\[\/size]"
    	strContent = re.Replace(strContent,"<font size=3>$1</font>")
    	re.Pattern ="\[size=4](.[^\[]*)\[\/size]"
    	strContent = re.Replace(strContent,"<font size=4>$1</font>")
		
		
	strContent = Replace(strContent,":)","<img src=face\smile.gif>")
	'strContent = Replace(strContent,":D","<img src=face\biggrin.gif>")
	'strContent = Replace(strContent,"8D","<img src=face\cool.gif>")
	'strContent = Replace(strContent,":I","<img src=face\blush.gif>")
	'strContent = Replace(strContent,":P","<img src=face\tongue.gif>")
	'strContent = Replace(strContent,"}:)","<img src=face\evil.gif>")
	strContent = Replace(strContent,";)","<img src=face\wink.gif>")
	'strContent = Replace(strContent,":o)","<img src=face\clown.gif>")
	strContent = Replace(strContent,":(","<img src=face\frown.gif>")
	'strContent = Replace(strContent,"8)","<img src=face\rolleyes.gif>")
	'strContent = Replace(strContent,":O","<img src=face\eek.gif>")
	'strContent = Replace(strContent,"[:(!]","<img src=face\angry.gif>")
	'strContent = Replace(strContent,"[xx(]","<img src=face\dead.gif>")
	'strContent = Replace(strContent,"[:X]","<img src=face\kisses.gif>")
	'strContent = Replace(strContent,"[|)]","<img src=face\sleepy.gif>")
	'strContent = Replace(strContent,"[^]","<img src=face\approve.gif>")
	'strContent = Replace(strContent,"[V]","<img src=face\dissapprove.gif>")
	'strContent = Replace(strContent,"[?]","<img src=face\confused.gif>")


	UBBCode = strContent
end function
%>

⌨️ 快捷键说明

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