?? asp.asp
字號(hào):
<%@ Language="VBScript" CODEPAGE="936"%>
<% Option Explicit %>
<%
Response.Buffer = True
Dim startime
startime=timer()
Dim hx
Set hx = New Cls_AspCheck
class Cls_AspCheck
Public FileName,WebName,WebUrl,SysName,SysNameE,SysVersion
'檢查組件是否被支持
Public Function IsObjInstalled(strClassString)
On Error Resume Next
Dim xTestObj
Set xTestObj = Server.CreateObject(strClassString)
If Err Then
IsObjInstalled = False
else
IsObjInstalled = True
end if
Set xTestObj = Nothing
End Function
'檢查組件版本
Public Function getver(Classstr)
On Error Resume Next
Dim xTestObj
Set xTestObj = Server.CreateObject(Classstr)
If Err Then
getver=""
else
getver=xTestObj.version
end if
Set xTestObj = Nothing
End Function
Public Function GetObjInfo(startnum,endnum)
dim i,Outstr
for i=startnum to endnum
Outstr = Outstr & "<tr bgcolor=#FFFFFF align=center height=18><TD align=left> " & theTestObj(i,0) & ""
Outstr = Outstr & "<font color=#888888> "&theTestObj(i,1)&"</font>"
Outstr = Outstr & "</td>"
If Not IsObjInstalled(theTestObj(i,0)) Then
Outstr = Outstr & "<td align=left> <font color=red><b>×</b></font></td>"
Else
Outstr = Outstr & "<td align=left> <font color=green><b>√</b></font> " & getver(theTestObj(i,0)) & "</td>"
End If
Outstr = Outstr & "</tr>" & vbCrLf
next
Response.Write(Outstr)
End Function
Public Function cdrivetype(tnum)
Select Case tnum
Case 0: cdrivetype = "未知"
Case 1: cdrivetype = "可移動(dòng)磁盤(pán)"
Case 2: cdrivetype = "本地硬盤(pán)"
Case 3: cdrivetype = "網(wǎng)絡(luò)磁盤(pán)"
Case 4: cdrivetype = "CD-ROM"
Case 5: cdrivetype = "RAM 磁盤(pán)"
End Select
end function
Private Sub Class_Initialize()
WebName="百度天下網(wǎng)"
WebUrl="http://www.everbaidu.com"
SysName="ASP探針"
SysNameE="AspCheck"
SysVersion="2007"
FileName=Request.ServerVariables("SCRIPT_NAME")
End Sub
Public Function dtype(num)
Select Case num
Case 0: dtype = "未知"
Case 1: dtype = "可移動(dòng)磁盤(pán)"
Case 2: dtype = "本地硬盤(pán)"
Case 3: dtype = "網(wǎng)絡(luò)磁盤(pán)"
Case 4: dtype = "CD-ROM"
Case 5: dtype = "RAM 磁盤(pán)"
End Select
End Function
Public Function formatdsize(dsize)
if dsize>=1073741824 then
formatdsize=Formatnumber(dsize/1073741824,2) & " GB"
elseif dsize>=1048576 then
formatdsize=Formatnumber(dsize/1048576,2) & " MB"
elseif dsize>=1024 then
formatdsize=Formatnumber(dsize/1024,2) & " KB"
else
formatdsize=dsize & "B"
end if
End Function
Public Function formatvariables(str)
on error resume next
str = cstr(server.htmlencode(str))
formatvariables=replace(str,chr(10),"<br>")
End Function
Public Sub ShowFooter()
dim Endtime,Runtime,OutStr
Endtime=timer()
OutStr = "<table border=0 cellpadding=0 cellspacing=1 class=tableBorder><tr><td align=center>"
OutStr = OutStr & "<p>歡迎訪問(wèn)<a href=http://www.everbaidu.com title=百度天下網(wǎng) target=_blank>★everbaidu.com★</a><br>" & vbcrlf
Runtime=FormatNumber((endtime-startime)*1000,2)
if Runtime>0 then
if Runtime>1000 then
OutStr = OutStr & "頁(yè)面執(zhí)行時(shí)間:約"& FormatNumber(runtime/1000,2) & "秒"
else
OutStr = OutStr & "頁(yè)面執(zhí)行時(shí)間:約"& Runtime & "毫秒"
end if
end if
OutStr = OutStr & " "
OutStr = OutStr & "</p></td></tr></table>"
Response.Write(OutStr)
End Sub
End class
Dim theTestObj(25,1)
theTestObj(0,0) = "MSWC.AdRotator"
theTestObj(1,0) = "MSWC.BrowserType"
theTestObj(2,0) = "MSWC.NextLink"
theTestObj(3,0) = "MSWC.Tools"
theTestObj(4,0) = "MSWC.Status"
theTestObj(5,0) = "MSWC.Counters"
theTestObj(6,0) = "MSWC.PermissionChecker"
theTestObj(7,0) = "WScript.Shell"
theTestObj(8,0) = "Microsoft.XMLHTTP"
theTestObj(9,0) = "Scripting.FileSystemObject"
theTestObj(9,1) = "(FSO 文本文件讀寫(xiě))"
theTestObj(10,0) = "ADODB.Connection"
theTestObj(10,1) = "(ADO 數(shù)據(jù)對(duì)象)"
theTestObj(11,0) = "SoftArtisans.FileUp"
theTestObj(11,1) = "(SA-FileUp 文件上傳)"
theTestObj(12,0) = "SoftArtisans.FileManager"
theTestObj(12,1) = "(SoftArtisans 文件管理)"
theTestObj(13,0) = "LyfUpload.UploadFile"
theTestObj(13,1) = "(劉云峰的文件上傳組件)"
theTestObj(14,0) = "Persits.Upload"
theTestObj(14,1) = "(ASPUpload 文件上傳)"
theTestObj(15,0) = "w3.upload"
theTestObj(15,1) = "(Dimac 文件上傳)"
theTestObj(16,0) = "JMail.SmtpMail"
theTestObj(16,1) = "(Dimac JMail 郵件收發(fā))</a>"
theTestObj(17,0) = "CDONTS.NewMail"
theTestObj(17,1) = "(虛擬 SMTP 發(fā)信)"
theTestObj(18,0) = "Persits.MailSender"
theTestObj(18,1) = "(ASPemail 發(fā)信)"
theTestObj(19,0) = "SMTPsvg.Mailer"
theTestObj(19,1) = "(ASPmail 發(fā)信)"
theTestObj(20,0) = "DkQmail.Qmail"
theTestObj(20,1) = "(dkQmail 發(fā)信)"
theTestObj(21,0) = "Geocel.Mailer"
theTestObj(21,1) = "(Geocel 發(fā)信)"
theTestObj(22,0) = "IISmail.Iismail.1"
theTestObj(22,1) = "(IISmail 發(fā)信)"
theTestObj(23,0) = "SmtpMail.SmtpMail.1"
theTestObj(23,1) = "(SmtpMail 發(fā)信)"
theTestObj(24,0) = "SoftArtisans.ImageGen"
theTestObj(24,1) = "(SA 的圖像讀寫(xiě)組件)"
theTestObj(25,0) = "W3Image.Image"
theTestObj(25,1) = "(Dimac 的圖像讀寫(xiě)組件)"
%>
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style>
<!--
A { COLOR: #000000; TEXT-DECORATION: none}
A:hover { COLOR: green}
body,td,span { font-size: 9pt}
.input { BACKGROUND-COLOR: #ffffff;BORDER:#0099CF 1px solid;FONT-SIZE: 9pt}
.backc { BACKGROUND-COLOR: #0099CF;BORDER:#0099CF 1px solid;FONT-SIZE: 9pt;color:white}
.PicBar { background-color: #0099CF; border: 1px solid #000000; height: 12px;}
.tableBorder {BORDER-RIGHT: #183789 1px solid; BORDER-TOP: #183789 1px solid; BORDER-LEFT: #183789 1px solid; BORDER-BOTTOM: #183789 1px solid; BACKGROUND-COLOR: #ffffff; WIDTH: 600;}
.divcenter {position:absolute;height:30px;z-index:1000;}
-->
</STYLE>
<SCRIPT language="JavaScript" runat="server">
function getEngVerJs(){
try{
return ScriptEngineMajorVersion() +"."+ScriptEngineMinorVersion()+"."+ ScriptEngineBuildVersion() + " ";
}catch(e){
return "服務(wù)器不支持此項(xiàng)檢測(cè)";
}
}
</SCRIPT>
<SCRIPT language="VBScript" runat="server">
Function getEngVerVBS()
getEngVerVBS=ScriptEngineMajorVersion() &"."&ScriptEngineMinorVersion() &"." & ScriptEngineBuildVersion() & " "
End Function
</SCRIPT>
<script language="javascript">
<!--
function Checksearchbox()
{
if(form1.classname.value == "")
{
alert("請(qǐng)輸入你要檢測(cè)的組件名!");
form1.classname.focus();
return false;
}
}
function showsubmenu(sid)
{
whichEl = eval("submenu" + sid);
if (whichEl.style.display == "none")
{
eval("submenu" + sid + ".style.display=\"\";");
eval("txt" + sid + ".innerHTML=\"<a href='#' title='關(guān)閉此項(xiàng)'><font face='Wingdings' color=#FFFFFF>x</font></a>\";");
}
else
{
eval("submenu" + sid + ".style.display=\"none\";");
eval("txt" + sid + ".innerHTML=\"<a href='#' title='打開(kāi)此項(xiàng)'><font face='Wingdings' color=#FFFFFF>y</font></a>\";");
}
}
-->
</SCRIPT>
</HEAD>
<BODY leftmargin="50">
<a name=top></a>
<br>
<%
dim action
action=request("action")
if action="testzujian" then
call ObjTest2
end if
Call menu
Call SystemTest
Call ObjTest
Call CalculateTest
Call DriveTest
Call SpeedTest
hx.ShowFooter
Set hx= nothing
%>
<%Sub menu%>
選項(xiàng):<a href="#SystemTest">服務(wù)器有關(guān)參數(shù)</a> | <a href="#ObjTest">服務(wù)器組件情況</a> | <a href="#CalcuateTest">服務(wù)器運(yùn)算能力</a>
| <a href="#DriveTest">服務(wù)器磁盤(pán)信息</a> | <a href="#SpeedTest">服務(wù)器連接速度</a>
<%End Sub%>
<%Sub smenu(i)%>
<a href="#top" title="返回頂部"><font face='Webdings' color=#FFFFFF>5</font></a> <span id=txt<%=i%> name=txt<%=i%>><a href='#' title='關(guān)閉此項(xiàng)'><font face='Wingdings' color=#FFFFFF>x</font></a></span>
<%End Sub%>
<%Sub SystemTest
on error resume next
%>
<a name="SystemTest"></a>
<table border="0" cellpadding="0" cellspacing="1" class="tableBorder">
<tr>
<td height="25" align="center" bgcolor="#0099CF" onclick="showsubmenu(0)"><font color=#FFFFFF><strong>服務(wù)器有關(guān)參數(shù)</strong></font>
<%Call smenu(0)%></td>
</tr>
<tr>
<td style="display" id='submenu0'><table border=0 width=100% cellspacing=1 cellpadding=3 bgcolor="#0099CF">
<tr bgcolor="#FFFFFF" height=18>
<td width="130"> 服務(wù)器名</td>
<td width="170" height="18"> <%=Request.ServerVariables("SERVER_NAME")%></td>
<td width="130" height="18"> 服務(wù)器操作系統(tǒng)</td>
<td width="170" height="18"> <%=Request.ServerVariables("OS")%></td>
</tr>
<tr bgcolor="#FFFFFF" height=18>
<td> 服務(wù)器IP</td>
<td> <%=Request.ServerVariables("LOCAL_ADDR")%></td>
<td> 服務(wù)器端口</td>
<td> <%=Request.ServerVariables("SERVER_PORT")%></td>
</tr>
<tr bgcolor="#FFFFFF" height=18>
<td> 服務(wù)器時(shí)間</td>
<td> <%=now%></td>
<td> 服務(wù)器CPU數(shù)量</td>
<td> <%=Request.ServerVariables("NUMBER_OF_PROCESSORS")%>
個(gè)</td>
</tr>
<tr bgcolor="#FFFFFF" height=18>
<td> IIS版本</td>
<td height="18"> <%=Request.ServerVariables("SERVER_SOFTWARE")%></td>
<td height="18"> 腳本超時(shí)時(shí)間</td>
<td height="18"> <%=Server.ScriptTimeout%> 秒</td>
</tr>
<tr bgcolor="#FFFFFF" height=18>
<td> Application變量</td>
<td height="18"> <%Response.Write(Application.Contents.Count & "個(gè) ")
if Application.Contents.count>0 then Response.Write("[<a href=""?action=showapp"">遍歷Application變量</a>]")%>
</td>
<td height="18"> Session變量<br> </td>
<td height="18"> <%Response.Write(Session.Contents.Count&"個(gè) ")
if Session.Contents.count>0 then Response.Write("[<a href=""?action=showsession"">遍歷Session變量</a>]")%>
</td>
</tr>
<tr bgcolor="#FFFFFF" height=18>
<td height="18"> <a href="?action=showvariables">所有服務(wù)器參數(shù)</a></td>
<td height="18"> <%Response.Write(Request.ServerVariables.Count&"個(gè) ")
if Request.ServerVariables.Count>0 then Response.Write("[<a href=""?action=showvariables"">遍歷服務(wù)器參數(shù)</a>]")%>
</td>
<td height="18"> 服務(wù)器環(huán)境變量</td>
<td height="18"> <%
dim WshShell,WshSysEnv
Set WshShell = server.CreateObject("WScript.Shell")
Set WshSysEnv = WshShell.Environment
if err then
Response.Write("服務(wù)器不支持WScript.Shell組件")
err.clear
else
Response.Write(WshSysEnv.count &"個(gè) ")
if WshSysEnv.count>0 then Response.Write("[<a href=""?action=showwsh"">遍歷環(huán)境變量</a>]")
end if
%>
</td>
</tr>
<tr bgcolor="#FFFFFF" height=18>
<td align=left> 服務(wù)器解譯引擎</td>
<td height="18" colspan="3"> JScript: <%= getEngVerJs() %> | VBScript: <%=getEngVerVBS()%></td>
</tr>
<tr bgcolor="#FFFFFF" height=18>
<td align=left bgcolor="#FFFFFF"> 本文件實(shí)際路徑</td>
<td height="8" colspan="3" bgcolor="#FFFFFF"> <%=server.mappath(Request.ServerVariables("SCRIPT_NAME"))%></td>
</tr>
</table>
<%
if action="showapp" or action="showsession" or action="showvariables" or action="showwsh" then
showvariable(action)
end if
%>
</td>
</tr>
</table>
<br>
<%
End Sub
Sub showvariable(action)
%>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#0099CC">
<tr bgcolor="#99CCFF">
<td colspan="2">
<%
on error resume next
dim Item,xTestObj,outstr
if action="showapp" then
Response.Write("<font face='Webdings'>4</font> 遍歷Application變量")
set xTestObj=Application.Contents
elseif action="showsession" then
Response.Write("<font face='Webdings'>4</font> 遍歷Session變量")
set xTestObj=Session.Contents
elseif action="showvariables" then
Response.Write("<font face='Webdings'>4</font> 遍歷服務(wù)器參數(shù)")
set xTestObj=Request.ServerVariables
elseif action="showwsh" then
Response.Write("<font face='Webdings'>4</font> 遍歷環(huán)境變量")
dim WshShell
Set WshShell = server.CreateObject("WScript.Shell")
set xTestObj=WshShell.Environment
end if
Response.Write "(<a href="&hx.FileName&">關(guān)閉</a>)"
%>
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="130">變量名</td>
<td width="470">值</td>
</tr>
<%
if err then
outstr = "<tr bgcolor=#FFFFFF><td colspan=2>沒(méi)有符合條件的變量</td></tr>"
err.clear
else
dim w
if action="showwsh" then
for each Item in xTestObj
w=split(Item,"=")
outstr = outstr & "<tr bgcolor=#FFFFFF>"
outstr = outstr & "<td>" & w(0) & "</td>"
outstr = outstr & "<td>" & w(1) & "</td>"
outstr = outstr & "</tr>"
next
else
dim i
for each Item in xTestObj
outstr = outstr & "<tr bgcolor=#FFFFFF>"
outstr = outstr & "<td>" & Item & "</td>"
outstr = outstr & "<td>"
if IsArray(xTestObj(Item)) then
for i=0 to ubound(xTestObj(Item))-1
outstr = outstr & hx.formatvariables(xTestObj(Item)(i)) & "<br>"
next
else
outstr = outstr & hx.formatvariables(xTestObj(Item))
end if
outstr = outstr & "</td>"
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -