📄 functions.asp
字号:
<%
'本文件内的所有函数均不能作任何修改,否则会影响系统正常运行。
function lleft(content,lef)
for le=1 to len(content)
if asc(mid(content,le,1))<0 then
lef=lef-2
else
lef=lef-1
end if
if lef<=0 then exit for
next
lleft=left(content,le)
end function
function llen(content)
truelen=0
for le=1 to len(content)
if asc(mid(content,le,1))<0 then
truelen=truelen+2
else
truelen=truelen+1
end if
next
llen=truelen
end function
'格式显示数字
function FormatNum(num,n)
if num<1 then
num="0"&cstr(FormatNumber(num,n))
else
num=cstr(FormatNumber(num,n))
end if
FormatNum=replace(num,",","")
end function
function buyoktxtcheck(txt)
buyoktxtcheck=txt
chrtxt="33|34|35|36|37|38|39|40|41|42|43|44|47|58|59|60|61|62|63|91|92|93|94|96|123|124|125|126|128"
chrtext=split(chrtxt,"|")
for c=0 to ubound(chrtext)
buyoktxtcheck=replace(buyoktxtcheck,chr(chrtext(c)),"")
next
end function
sub checklogin()
set rscheck=conn.execute("select * from s_buser where UserId='"&request.cookies("buyok")("userid")&"'")
if rscheck.eof and rscheck.bof then
response.write "<script language='javascript'>"
response.write "alert('对不起,您还没有注册或登陆。');"
response.write "location.href='javascript:history.go(-1)';"
response.write "</script>"
response.end
end if
set rscheck=nothing
end sub
function checkuserkou()
if request.cookies("buyok")("userid")="" then
checkuserkou=10
else
checkuserkou=request.cookies("buyok")("userkou")
if request.cookies("buyok")("userkou")="" then checkuserkou=10
end if
end function
sub mGoBack(strAlert)
response.write "<script language='javascript'>"
response.write "alert('"+strAlert+"');"
response.write "location.href='javascript:history.go(-1)';"
response.write "</script>"
response.end
end sub
sub mGoTo(url,strAlert)
response.write "<script language='javascript'>"
response.write "alert('"+strAlert+"');"
response.write "location.href='"&url&"';"
response.write "</script>"
response.end
end sub
sub mPage(url,page,allpages)
if page = 1 then
response.write "<font color=darkgray>首页 前页</font>"
else
response.write "<a href="&url&"&page=1>首页</a> <a href="&url&"&page="&page-1&">前页</a>"
end if
if page = allpages then
response.write "<font color=darkgray> 下页 末页</font>"
else
response.write " <a href="&url&"&page="&page+1&">下页</a> <a href="&url&"&page="&allpages&">末页</a>"
end if
response.write " 第"&page&"页 共"&allpages&"页 转到第 "
response.write "<select name='kkpage' onChange='javascript:location.href="""&url&"&page=""+this.value;'>"
for i=1 to allpages
response.write "<option value="&i&">"&i&"</option>"
next
response.write "</select> 页"
end sub
function aspsql(str)
if isnull(str) then
aspsql=""
exit function
end if
if str="" then
aspsql=""
exit function
end if
str=trim(str)
str=replace(trim(str),"'","`")
aspsql=replace(trim(str),"--","__")
end function
sub check_path()
url=LCase("localhost")
if LCase(Request.ServerVariables("SERVER_NAME"))<>url then
response.Redirect("error.asp?error=001")
end if
'response.Write "<script language='javascript'>"
'response.Write "sit=top.location.href;"
'response.Write "if(top.location.href!='http://"&url&"/admin/admin.asp')"
'response.Write "this.location.href='error.asp?error=001';"
'response.Write "</script>"
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -