当前位置: 代码迷 >> vbScript >> 怎么监控系统进程
  详细解决方案

怎么监控系统进程

热度:1813   发布时间:2013-02-26 00:00:00.0
如何监控系统进程
现在想实现这样的效果,就是当用户打开我的网站的某个页面的时候,自动监控客户机上的进程,看有没有某个特定的进程,如果有就不让客户浏览这个页面,没有才可以浏览,我的网站是用PHP开发的,请各位高手帮忙解决,急急急!!!

------解决方案--------------------------------------------------------
试试这个:

process.htm
HTML code
 <html> 
<head>
<title>process </title>
<script language=vbscript>
Function JinCheng()
'Const Name = "iexplore.exe"
'Const Name = "PPLiveVAMonitor.exe"
Dim Name
Name = document.getElementById("ProcId").value

Dim WShell, WbemLctr, WbemSrvc, PrcSet, ToUrl

'Set WShell=CreateObject("WScript.Shell")
Set WbemLctr = GetObject("","WbemScripting.SWbemLocator")
Set WbemSrvc = WbemLctr.ConnectServer(,"root\cimv2")
set PrcSet = WbemSrvc.ExecQuery("select * from win32_process where name='" & Name & "'")
If PrcSet.Count > 0 then
  MsgBox PrcSet.Count & " instances of " & Name & " are running.",,"Running"
  ToUrl = "http://www.google.cn"
Else
  MsgBox "No instance of " & Name & " is running.",,"Not Running"
  ToUrl = "http://www.baidu.com"
End If

Set PrcSet = Nothing
Set WbemSrvc = Nothing
Set WbemLctr = Nothing
location.href = ToUrl
'Set WShell = Nothing
End Function
</script>
</head>

<body>
<input type=text id=ProcId size=30> <input type=button value="检查并跳转" onclick="JinCheng()">
</body>
</html>
  相关解决方案