当前位置:DOS资源站资料中心VBS脚本 → 终端登陆监视脚本

终端登陆监视脚本

减小字体 增大字体 作者:佚名  来源:本站整理  发布时间:2008-5-7 15:31:21

on error resume next
set arg=wscript.arguments
If arg.count=0 then
wscript.echo "use:// cscript.exe FS.vbs port"
sleep 1000
wscript.quit
End If
Tport=arg(0)
Runs=false
While runs=false
Dim oShell,oExec,strOut,oRegExp,Matches,Match,Num,Tport
Set oShell = WScript.CreateObject("WScript.Shell")
Set oExec = oShell.Exec("netstat -an")
Set oRegExp = new RegExp
oRegExp.Pattern = "TCP[\s]+[\d\.]+:"&Tport&"[\s]+[\d\.]+:[\d]+[\s]+ESTABLISHED"
oRegExp.IgnoreCase = True
oRegExp.Global = True

Do While Not oExec.StdOut.AtEndOfStream
     strOut = strOut & oExec.StdOut.ReadLine() & Chr(13) & Chr(10)
Loop

Set Matches = oRegExp.Execute(strOut)

Num = 0
For Each Match In Matches
     Num = Num + 1
Next
if num > 1 then
Runs=true
oShell.run "logoff"
end if
Set Matches = Nothing
Set oRegExp = Nothing
Set oExec = Nothing
Set oShell = Nothing
wend

  • ·上一篇文章:FlashFXP解密 VBS版本
  • ·下一篇文章:把脚本转成一句形式
  • ·百度中搜索更多的关于“终端登陆监视脚本”相关内容
  • ·谷歌中搜索更多的关于“终端登陆监视脚本”相关内容
  • ******申明******
  • 本站文章内容有部分为收录网络中其他网友内容,DOS资源站不保证所有的代码都适合你使用。
  • 由于编辑匆忙,有可能造成某些脚本文件出现丢失代码或代码无法运行的情况,请网友根据情况自行修改。
  • 如果能将出错部分反馈给我,那就更好了。