📄 safe.asp
字号:
strTemp = strTemp & CheckStr(Request.ServerVariables("SERVER_NAME"))
If Request.ServerVariables("SERVER_PORT") <> 80 Then strTemp = strTemp & ":" & CheckStr(Request.ServerVariables("SERVER_PORT"))
strTemp = strTemp & CheckStr(Request.ServerVariables("URL"))
lenstrTemp=len(strTemp)+1
if instr(left(linkfile,lenstrTemp),"?")>0 then
if blockPage = 1 Then
Response.Write "【←前10页"
Else
Response.Write("【<a href=" & LinkFile & "&page="&blockPage-10&">←前10页</a>")
End If
i=1
Do Until i > 10 or blockPage > n
If blockPage=int(gopage) Then
Response.Write("<font color=#FF0000>["&blockPage&"]</font>")
Else
Response.Write("<a href=" & LinkFile & "&page="&blockPage&">["&blockPage&"]</a> ")
End If
blockPage=blockPage+1
i = i + 1
Loop
if blockPage > totalpage Then
Response.Write "后10页→】"
Else
Response.Write("<a href=" & LinkFile & "&page="&blockPage&">后10页→</a>】")
End If
response.write"<select onchange=if(this.options[this.selectedIndex].value!=''){location=this.options[this.selectedIndex].value;}>"
for i=1 to totalpage
response.write"<option value='" & LinkFile & "&page=" & i & "'"
if i=gopage then response.write"selected"
response.write">"&i&"</option>"
next
response.write"</select>"
response.write" 页<Br>"
else
if blockPage = 1 Then
Response.Write "【←前10页"
Else
Response.Write("【<a href=" & LinkFile & "?page="&blockPage-10&">←前10页</a>")
End If
i=1
Do Until i > 10 or blockPage > n
If blockPage=int(gopage) Then
Response.Write("<font color=#FF0000>["&blockPage&"]</font>")
Else
Response.Write("<a href=" & LinkFile & "?page="&blockPage&">["&blockPage&"]</a> ")
End If
blockPage=blockPage+1
i = i + 1
Loop
if blockPage > totalpage Then
Response.Write "后10页→】"
Else
Response.Write("<a href=" & LinkFile & "?page="&blockPage&">后10页→</a>】")
End If
response.write"<select onchange=if(this.options[this.selectedIndex].value!=''){location=this.options[this.selectedIndex].value;}>"
for i=1 to totalpage
response.write"<option value='" & LinkFile & "?page=" & i & "'"
if i=gopage then response.write"selected"
response.write">"&i&"</option>"
next
response.write"</select>"
response.write" 页<Br>"
End If
Startinfo=((gopage-1)*msg_per_page)+1
Endinfo=gopage*msg_per_page
if Endinfo>totalrec then Endinfo=totalrec
Response.Write(" 共 "&totalrec&" 条信息 当前显示第 "&Startinfo&" - "&Endinfo&" 条 每页 "&msg_per_page&" 条信息 共 "&n&" 页")
end if
End Function
'分页2
Function listPages2(LinkFile)
if not (rs.eof and rs.bof) then
gopage=currentpage
totalpage=n
blockPage=Int((gopage-1)/10)*10+1
If LCase(Request.ServerVariables("HTTPS")) = "off" Then
strTemp = "http://"
Else
strTemp = "https://"
End If
strTemp = strTemp & CheckStr(Request.ServerVariables("SERVER_NAME"))
If Request.ServerVariables("SERVER_PORT") <> 80 Then strTemp = strTemp & ":" & CheckStr(Request.ServerVariables("SERVER_PORT"))
strTemp = strTemp & CheckStr(Request.ServerVariables("URL"))
lenstrTemp=len(strTemp)+1
if instr(left(linkfile,lenstrTemp),"?")>0 then
if blockPage = 1 Then
Response.Write "前10页"
Else
Response.Write("<a href=" & LinkFile & "&page="&blockPage-10&">前10页</a>")
End If
i=1
Do Until i > 10 or blockPage > n
If blockPage=int(gopage) Then
Response.Write("<font color=#FF0000>"&blockPage&"</font>")
Else
Response.Write("<a href=" & LinkFile & "&page="&blockPage&">"&blockPage&"</a> ")
End If
blockPage=blockPage+1
i = i + 1
Loop
if blockPage > totalpage Then
Response.Write "后10页"
Else
Response.Write("<a href=" & LinkFile & "&page="&blockPage&">后10页</a>")
End If
response.write"<select onchange=if(this.options[this.selectedIndex].value!=''){location=this.options[this.selectedIndex].value;}>"
for i=1 to totalpage
response.write"<option value='" & LinkFile & "&page=" & i & "'"
if i=gopage then response.write"selected"
response.write">"&i&"</option>"
next
response.write"</select>"
response.write" 页<Br>"
else
if blockPage = 1 Then
Response.Write "【←前10页</span>"
Else
Response.Write("【<a href=" & LinkFile & "?page="&blockPage-10&">←前10页</a>")
End If
i=1
Do Until i > 10 or blockPage > n
If blockPage=int(gopage) Then
Response.Write("<font color=#FF0000>["&blockPage&"]</font>")
Else
Response.Write("<a href=" & LinkFile & "?page="&blockPage&">["&blockPage&"]</a> ")
End If
blockPage=blockPage+1
i = i + 1
Loop
if blockPage > totalpage Then
Response.Write "后10页→】"
Else
Response.Write("<a href=" & LinkFile & "?page="&blockPage&">后10页→</a>】")
End If
response.write"<select onchange=if(this.options[this.selectedIndex].value!=''){location=this.options[this.selectedIndex].value;}>"
for i=1 to totalpage
response.write"<option value='" & LinkFile & "?page=" & i & "'"
if i=gopage then response.write"selected"
response.write">"&i&"</option>"
next
response.write"</select>"
response.write" 页<Br>"
End If
Startinfo=((gopage-1)*msg_per_page)+1
Endinfo=gopage*msg_per_page
if Endinfo>totalrec then Endinfo=totalrec
Response.Write(" 共 "&totalrec&" 条信息 当前显示第 "&Startinfo&" - "&Endinfo&" 条 每页 "&msg_per_page&" 条信息 共 "&n&" 页")
end if
End Function
'判断文件类型是否合格
Function CheckFileExt(FileExt)
Dim ForumUpload,i
ForumUpload="gif,jpg,bmp,jpeg,png"
ForumUpload=Split(ForumUpload,",")
CheckFileExt=False
For i=0 to UBound(ForumUpload)
If LCase(FileExt)=Lcase(Trim(ForumUpload(i))) Then
CheckFileExt=True
Exit Function
End If
Next
End Function
'格式后缀
Function FixName(UpFileExt)
If IsEmpty(UpFileExt) Then Exit Function
FixName = Lcase(UpFileExt)
FixName = Replace(FixName,Chr(0),"")
FixName = Replace(FixName,".","")
FixName = Replace(FixName,"asp","")
FixName = Replace(FixName,"asa","")
FixName = Replace(FixName,"aspx","")
FixName = Replace(FixName,"cer","")
FixName = Replace(FixName,"cdx","")
FixName = Replace(FixName,"htr","")
End Function
'文件Content-Type判断
Function CheckFileType(FileType)
CheckFileType = False
If Left(Cstr(Lcase(Trim(FileType))),6)="image/" Then CheckFileType = True
End Function
'获取IP地址
Function getIP()
Dim strIPAddr
If Request.ServerVariables("HTTP_X_FORWARDED_FOR") = "" OR InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), "unknown") > 0 Then
strIPAddr = Request.ServerVariables("REMOTE_ADDR")
ElseIf InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), ",") > 0 Then
strIPAddr = Mid(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), 1, InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), ",")-1)
ElseIf InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), ";") > 0 Then
strIPAddr = Mid(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), 1, InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), ";")-1)
Else
strIPAddr = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
End If
getIP = Trim(Mid(strIPAddr, 1, 30))
End Function
'分离关键词中字符
function splitChar(str)
oldstring=str
newstring=""
oldsign=0
newsign=0
i=len(oldstring)
for j=1 to i
if asc(mid(oldstring,j,1))<0 then
newsign=1
else
newsign=0
end if
if j=1 then
oldsign=newsign
end if
if oldsign=newsign then
newstring=newstring+mid(oldstring,j,1)
else
newstring=newstring+" "+mid(oldstring,j,1)
end if
oldsign=newsign
next
splitChar=newstring
end function
'突出显示匹配搜索关键词字符
Function dispRed(str,Dstr)
Dstrgroup=Split(Dstr, " ", -1, 1)
for i=0 to UBound(Dstrgroup)
if InStr(1,str,Dstrgroup(i),1)<>0 then
str1=mid(str,InStr(1,str,Dstrgroup(i),1),len(Dstrgroup(i)))
str=replace(str,Dstrgroup(i),"<font color=red>"&str1&"</font>",1,-1,1)
end if
next
dispRed=str
end Function
'URL数据获取
Function getUrl(url)
dim Str
dim Http
dim Arr
set Http=CreateObject("Microsoft.XMLHTTP")
Http.open "GET",url,false
Http.send()
if Http.readystate<>4 then
exit function
end if
Str=bytesToBSTR(Http.responseBody,"GB2312")
getUrl=Str
set http=nothing
if err.number<>0 then err.Clear
End Function
'格式化榨取数据
Function BytesToBstr(body,Cset)
dim objstream
set objstream = CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = Cset
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -