?? 事件查看器.asp
字號:
<html>
<head>
<title>事件查看器</title>
</head>
<body>
<%
Dim objLocator, objService, objWEBMCol, objWEBM, vType
Set objLocator = CreateObject("WbemScripting.SWbemLocator")
'Establish a connection to WMI
Set objService = objLocator.ConnectServer
'Get the Webm Service object
Set objWEBMCol = objService.ExecQuery("SELECT * FROM " & _
" win32_NTLogEvent WHERE LogFile='system'")
Response.write "<H2><center>事件查看器</center></H2><HR><UL>"
'Enumerate
%>
<table border=1 width=120%>
<tr>
<td width=10%>計算機</td><td width=8%>來源</td><td width=8%>事件</td><td width=10%>類型</td><td>消息描述</td><td width=20%>用戶</td>
</tr>
<%
For Each objWEBM in objWEBMCol
vType = ""
if objWEBM.Type = "error" then
vType = "錯誤"
elseif objWEBM.Type = "warning" then
vType = "警告"
elseif objWEBM.Type = "information" then
vType = "信息"
else
vType=objWEBM.Type
end if
Response.write "<tr><td>" & objWEBM.ComputerName & _
"</td><td>" & objWEBM.SourceName & _
"</td><td>" & objWEBM.EventCode & _
"</td><td>" & vType & _
"</td><td>" & left(objWEBM.Message,15) & _
"……</td><td>" & objWEBM.User
Next
response.write "</td></tr></table>"
Set objLocator = Nothing
Set objService = Nothing
Set objWEBMCol = Nothing
Set objWEBM = Nothing
%>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -