/ Published in: Pseudocode
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
; Show network connections between your machine and others. isRunning(processName) { Process, Exist, processName tmp := ErrorLevel if tmp > 0: return tmp else return 1 } getConnections() { status := Run %comspec% /c ""C:\Windows\System32\netstat.exe" "-o" > "netstatus.txt"" FileRead, status, netstatus.txt FileDelete, netstatus.txt Return, status } translateOutputToGlobals(connectionString) { Global StringTrimLeft, formatted, connectionString, 100 ArrayCount = 0 Loop, Parse, formatted, `n, `r { if StrLen(A_LoopField) > 20 { ArrayCount += 1 Array%ArrayCount% := A_LoopField } } } Gui, Add, Text,, % "Skype is running (X = pid of skype, 1 = no): " isRunning("skype.exe") Gui, Add, ListView, r20 w700, INFO translateOutputToGlobals(getConnections()) Loop %ArrayCount% { el := Array%A_Index% LV_Add("", el) } Gui, Show