📄 chkserver.asp
字号:
<br>
<table width="97%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableBorder">
<tr>
<td colspan="6" class="title"><div align="center" class="title">磁盘相关测试</div></td>
</tr>
<tr height=18>
<td colspan="6" align=left class="title3">■ 服务器磁盘信息 </td>
</tr>
<tr height=18>
<td width="14%" align=left class="items"><div align="center">盘符和磁盘类型</div></td>
<td width="7%" align=left class="items"><div align="center">就绪</div></td>
<td width="16%" align=left class="items"><div align="center">卷标</div></td>
<td width="20%" align=left class="items"><div align="center">文件系统</div></td>
<td width="23%" align=left class="items"><div align="center">可用空间</div></td>
<td width="20%" align=left class="items"><div align="center">总空间</div></td>
</tr>
<%
' 测试磁盘信息的想法来自“COCOON ASP 探针”
set drvObj=fsoobj.Drives
for each d in drvObj
%>
<tr height=18>
<td align=left class="table"> <%=cdrivetype(d.DriveType) & " " & d.DriveLetter%>:</td>
<%
if d.DriveLetter = "A" then '为防止影响服务器,不检查软驱
Response.Write "<td colspan=5 class='table' align='center'>为防止影响服务器,未检查软驱</td>"
else%>
<td align=left class="table"> <%=cIsReady(d.isReady)%></td>
<td align=left class="table"> <%=d.VolumeName%></td>
<td align=left class="table"> <%=d.FileSystem%></td>
<td align=left class="table"> <%=cSize(d.FreeSpace)%></td>
<td align=left class="table"> <%=cSize(d.TotalSize)%></td>
<%end if%>
</tr>
<%next%>
<tr height=18>
<td colspan="6" align=left class="title3">■ 当前文件夹信息
<%
Response.Flush
dPath = server.MapPath("./")
set dDir = fsoObj.GetFolder(dPath)
set dDrive = fsoObj.GetDrive(dDir.Drive)
%>
文件夹: <%=dPath%> </td>
</tr>
<tr height=18>
<td colspan="2" align=left class="items"><div align="center">已用空间</div></td>
<td align=left class="items"><div align="center">可用空间</div></td>
<td align=left class="items"><div align="center">文件夹数</div></td>
<td align=left class="items"><div align="center">文件数</div></td>
<td align=left class="items"><div align="center">创建时间</div></td>
</tr>
<tr height=18>
<td colspan="2" align=left class="table"><div align="center"><%=cSize(dDir.Size)%></div></td>
<td align=left class="table"><div align="center"><%=cSize(dDrive.AvailableSpace)%></div></td>
<td align=left class="table"><div align="center"><%=dDir.SubFolders.Count%></div></td>
<td align=left class="table"><div align="center"><%=dDir.Files.Count%></div></td>
<td align=left class="table"><div align="center"><%=dDir.DateCreated%></div></td>
</tr>
<tr height=18>
<td colspan="6" align=left class="title3">■ 磁盘文件操作速度测试<br>
<span class="table"> </span><span class="table"> </span>
<%
Response.Flush
' 测试文件读写的想法来自“迷城浪子”
Response.Write "正在重复创建、写入和删除文本文件50次..."
dim thetime3,tempfile,iserr
iserr=false
t1=timer
tempfile=server.MapPath("./") & "\aspchecktest.txt"
for i=1 to 50
Err.Clear
set tempfileOBJ = FsoObj.CreateTextFile(tempfile,true)
if Err <> 0 then
Response.Write "创建文件错误!<br><br>"
iserr=true
Err.Clear
exit for
end if
tempfileOBJ.WriteLine "Only for test. Ajiang ASPcheck"
if Err <> 0 then
Response.Write "写入文件错误!<br><br>"
iserr=true
Err.Clear
exit for
end if
tempfileOBJ.close
Set tempfileOBJ = FsoObj.GetFile(tempfile)
tempfileOBJ.Delete
if Err <> 0 then
Response.Write "删除文件错误!<br><br>"
iserr=true
Err.Clear
exit for
end if
set tempfileOBJ=nothing
next
t2=timer
if iserr <> true then
thetime3=cstr(int(( (t2-t1)*10000 )+0.5)/10)
Response.Write "...已完成!<font color=red>" & thetime3 & "毫秒</font>。<br>"
Response.Flush
%></td>
</tr>
<tr height=18>
<td colspan="4" align=left class="items"> 供对照的服务器</td>
<td colspan="2" align=left class="items"> 完成时间(毫秒)</td>
</tr>
<tr height=18>
<td colspan="4" align=left class="table"> 华东数据hdidc.com主机<font color=#888888> 双至强2.4,1GddrEcc,SCSI36.4G)</font></td>
<td colspan="2" align=left class="table"> 32~75</td>
</tr>
<tr height=18>
<td colspan="4" align=left class="table"> 新丰信息港付费ASP+CGI空间</td>
<td colspan="2" align=left class="table"> 46~62</td>
</tr>
<tr height=18>
<td colspan="4" align=left class="table"> 68互联</td>
<td colspan="2" align=left class="table"> 78</td>
</tr>
<tr height=18>
<td colspan="4" align=left class="table"> 第5空间diy5.com四至强主机<font color=#888888>(P42.4,2GddrEcc,SCSI72.8G)</font></td>
<td colspan="2" align=left class="table"> 46~78</td>
</tr>
<tr height=18>
<td colspan="4" align=left class="table"> 百优科技 100u 主机</td>
<td colspan="2" align=left class="table"> 31~62</td>
</tr>
<tr height=18>
<td colspan="4" align=left class="table"> 点击网络主机</td>
<td colspan="2" align=left class="table"> 31~62</td>
</tr>
<tr height=18>
<td colspan="4" align=left class="table"> <font color=red>这台服务器: <%=Request.ServerVariables("SERVER_NAME")%></font> </td>
<td colspan="2" align=left class="table"> <font color=red><%=thetime3%></font></td>
</tr>
</table>
<%end if
Response.Flush
set fsoobj=nothing
end if%>
<br>
<table width="97%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableBorder">
<tr>
<td colspan="3" class="title"><div align="center">ASP脚本解释和运算速度测试</div></td>
</tr>
<tr height=18>
<td width="56%" align=left class="items"> 供对照的服务器及完成时间(毫秒)</td>
<td width="21%" align=left class="items"> 整数运算</td>
<td width="23%" align=left class="items"> 浮点运算</td>
</tr>
<tr height=18>
<td align=left class="table"> 百优科技 100u 主机, <font color=#888888>2003-11-1</font></td>
<td align=left class="table"> 181~233</td>
<td align=left class="table"> 156~218</td>
</tr>
<tr height=18>
<td align=left class="table"> 西部数码 west263 主机, <font color=#888888>2003-11-1</font></td>
<td align=left class="table"> 171~233</td>
<td align=left class="table"> 156~171</td>
</tr>
<tr height=18>
<td align=left class="table"> 联网科技 linkwww 主机, <font color=#888888>2003-11-1</font></td>
<td align=left class="table"> 181~203</td>
<td align=left class="table"> 171</td>
</tr>
<tr height=18>
<td align=left class="table"> 就是我www.9s5.com全功能(ASP+PHP+JSP)主机,<font color=#888888>2003-11-1</font></td>
<td align=left class="table"> 171~187</td>
<td align=left class="table"> 156~171</td>
</tr>
<tr height=18>
<td align=left class="table"> 永讯网络 Dnsmy 主机, <font color=#888888>2003-11-1</font></td>
<td align=left class="table"> 155~180</td>
<td align=left class="table"> 122~172</td>
</tr>
<tr height=18>
<td align=left class="table"> 数据互联 Hostidc.net 主机, <font color=#888888>2004-3-28</font></td>
<td align=left class="table"> 156~171</td>
<td align=left class="table"> 140~156</td>
</tr>
<tr height=18>
<td colspan="3" align=left class="title3"><%
Response.Flush
'感谢网际同学录 http://www.5719.net 推荐使用timer函数
'因为只进行50万次计算,所以去掉了是否检测的选项而直接检测
Response.Write " 整数运算测试,正在进行50万次加法运算..."
dim t1,t2,lsabc,thetime,thetime2
t1=timer
for i=1 to 500000
lsabc= 1 + 1
next
t2=timer
thetime=cstr(int(( (t2-t1)*10000 )+0.5)/10)
Response.Write "...已完成!<font color=red>" & thetime & "毫秒</font>。<br>"
Response.Write " 浮点运算测试,正在进行20万次开方运算..."
t1=timer
for i=1 to 200000
lsabc= 2^0.5
next
t2=timer
thetime2=cstr(int(( (t2-t1)*10000 )+0.5)/10)
Response.Write "...已完成!<font color=red>" & thetime2 & "毫秒</font>。<br>"
%></td>
</tr>
<tr height=18>
<td align=left class="table"> <font color=red>这台服务器: <%=Request.ServerVariables("SERVER_NAME")%></font> </td>
<td align=left class="table"> <font color=red><%=thetime%></font></td>
<td align=left class="table"> <font color=red><%=thetime2%></font></td>
</tr>
</table>
<%footer()%>
<%
function cdrivetype(tnum)
Select Case tnum
Case 0: cdrivetype = "未知"
Case 1: cdrivetype = "可移动磁盘"
Case 2: cdrivetype = "本地硬盘"
Case 3: cdrivetype = "网络磁盘"
Case 4: cdrivetype = "CD-ROM"
Case 5: cdrivetype = "RAM 磁盘"
End Select
end function
function cIsReady(trd)
Select Case trd
case true: cIsReady="<b>√</b>"
case false: cIsReady="<font color='red'><b>×</b></font>"
End Select
end function
function cSize(tSize)
if tSize>=1073741824 then
cSize=int((tSize/1073741824)*1000)/1000 & " GB"
elseif tSize>=1048576 then
cSize=int((tSize/1048576)*1000)/1000 & " MB"
elseif tSize>=1024 then
cSize=int((tSize/1024)*1000)/1000 & " KB"
else
cSize=tSize & "B"
end if
end function
sub getsysinfo()
on error resume next
Set WshShell = server.CreateObject("WScript.Shell")
Set WshSysEnv = WshShell.Environment("SYSTEM")
okOS = cstr(WshSysEnv("OS"))
okCPUS = cstr(WshSysEnv("NUMBER_OF_PROCESSORS"))
okCPU = cstr(WshSysEnv("PROCESSOR_IDENTIFIER"))
if isnull(okCPUS) then
okCPUS = Request.ServerVariables("NUMBER_OF_PROCESSORS")
elseif okCPUS="" then
okCPUS = Request.ServerVariables("NUMBER_OF_PROCESSORS")
end if
if Request.ServerVariables("OS")="" then okOS=okOS & "(可能是 Windows Server 2003)"
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -