May 22

列出所有到本机80端口ESTABLISHED连接的小脚本 不指定

zpgm , 20:18 , 网络资源 , 评论(1) , 引用(0) , 阅读(260) , Via 本站原创 | |

Dim oShell
Dim oExec
Dim strOut
Dim oRegExp
Dim Matches
Dim Match
Dim Num
Set oShell = WScript.CreateObject("WScript.Shell")
Set oExec = oShell.Exec("netstat -an")
Set oRegExp = new RegExp
oRegExp.Pattern = "TCP[\s]+[\d\.]+:80[\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
     WScript.Echo Match.Value
     Num = Num + 1
Next
WScript.Echo "合计:共" & Num & "个连接"
Set Matches = Nothing
Set oRegExp = Nothing
Set oExec = Nothing
Set oShell = Nothing
Tags:
g Email Homepage
2009/09/15 13:17
分页: 1/1 第一页 1 最后页
发表评论

昵称

网址

电邮

打开HTML 打开UBB 打开表情 隐藏 记住我 [登入] [注册]