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

📄 char_inc.asp

📁 很好的一个论坛原代码
💻 ASP
字号:
<%
function ChkSql(StrSql)
	if IsNull(StrSql) then
		ChkStr = ""
		exit function 
	end if
	ChkSql = Replace(StrSql, "'", "''")
end function

function IsValidSqlValue(StrSql)
	IsValidSqlValue = false
	if IsNull(StrSql) then
		IsValidSqlValue = true
		exit function 
	end if
	StrSql = Replace(StrSql, "'", "''")
	if instr(StrSql,"=")>0 or Instr(StrSql,"%")>0 or instr(StrSql,chr(32))>0 or instr(StrSql,"?")>0 or instr(StrSql,"&")>0 or instr(StrSql,";")>0 or instr(StrSql,",")>0 or instr(StrSql,"'")>0 or instr(StrSql,"#")>0 or instr(StrSql,chr(34))>0 or instr(StrSql,chr(9))>0 or instr(StrSql," ")>0 or instr(StrSql,"$")>0 or instr(StrSql,"|")>0 or instr(StrSql,"@")>0 or instr(StrSql,"(")>0 or instr(StrSql,"<")>0 or instr(StrSql,">")>0 then
		IsValidSqlValue = false
	else
		IsValidSqlValue = true
	end if
end function

function IsValidEmail(email)
	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

function strLength(str)
       ON ERROR RESUME NEXT
       dim LAN_CH
       LAN_CH = (len("雪人")=2)
       if LAN_CH then
          dim l,t,c
          dim i
          l = len(str)
          t = l
          for i = 1 to l
             c = asc(mid(str,i,1))
             if c < 0 then c=c+65536
             if c > 255 then
                t = t+1
             end if
          next
          strLength = t
       else 
          strLength = len(str)
       end if
       if err.number <> 0 then err.clear
end function

function CutStr(str,strlen)
	dim l,t,c
	l = len(str)
	t = 0
	for i = 1 to l
	c = Abs(Asc(Mid(str,i,1)))
	if c>255 then
	t = t+2
	else
	t = t+1
	end if
	if t >= strlen then
	CutStr=left(str,i)&"..."
	exit for
	else
	CutStr = str
	end if
	next
	' CutStr = replace(CutStr,chr(10),"")
end function

function formatstr(String)
if not isnull(String) then
String = Replace(String, CHR(13), "")
String = Replace(String, CHR(10) & CHR(10), "</p><p>")
String = Replace(String, CHR(10), "<br>")
formatstr = String
end if
end function

function IsMember(forumid, memberlist)
	IsMember = false
	if not isnull(memberlist) then
		member_array = split(memberlist, ",")
		j = ubound(member_array)
		for i = 0 to j
			if member_array(i) = request.cookies("sf")("username") then
				IsMember = true
				exit for
			end if
		next
	end if
end function

function GetExpFilename(str)
	for i = len(str) to 1 step -1
		if mid(str, i, 1) = chr(asc(".")) then
			str = right(str, len(str)-i)
			exit for
		end if
	next
	GetExpFilename = str
end function

function bin2str(binstr)
	dim varlen, clow, ccc, skipflag
	skipflag = 0
	ccc = ""
	varlen = lenb(binstr)
	for i = 1 to varlen
		if skipflag = 0 then
			clow = midb(binstr, i, 1)
			if ascb(clow) > 127 then
				ccc = ccc & chr(ascw(midb(binstr, i + 1, 1) & clow))
				skipflag = 1
			else
				ccc = ccc & chr(ascb(clow))
			end if
		else
			skipflag = 0
		end if
	next
	bin2str = ccc
end function

function str2bin(str)
	for i = 1 to len(str)
		str2bin = str2bin & chrb(asc(mid(str, i, 1)))
	next
end function

function killbadword(str)
	killbadword = ""
	if str <> "" and badwordlist <> "" then
		badword = split(badwordlist, "|")
		for i = 0 to ubound(badword)
			str = replace(str, badword(i), string(len(badword(i)), "*"), 1,-1,1) 
		next
		killbadword = str
	end if
end function

function getipaddress()
getipaddress = request.ServerVariables("HTTP_X_FORWARDED_FOR")
if getipaddress = "" then getipaddress = request.ServerVariables("REMOTE_ADDR")
end function
%>

⌨️ 快捷键说明

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