-- result = Input.GetText("Input1"); -- Page.SetObjectScript(this, "On Click", Input.GetText("Input1")); -- Page.CreateObject(OBJECT_BUTTON, "NewObject", nil); -- Page.SetObjectScript("Button1", "On Click", ""); -- WinCmd.Input(Input.GetText("tbInput")); WinCmd.Input("netstat -p TCP -b -n -b -a"); resposta = WinCmd.Output() .. WinCmd.Error(); -- erro = WinCmd.Error(); if (String.Find(resposta, " 0.0.0.0:80 ", 1, false) > 0) then --[[ and (String.Find(resposta .. erro, "[httpd.exe]", 1, false) > 0) then result = Dialog.Message("Notice", "apache is alive", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1); else result = Dialog.Message("Notice", "apache is dead.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1); end ]]-- function fnMiolo(strMassa, strInicio, strFim) local temp = strMassa; local strAnchor = strInicio; local nAnchorLength = String.Length(strAnchor); local strEndAnchor = strFim; local nEndAnchorLength = String.Length(strEndAnchor); local nFoundPos = String.Find(temp,strAnchor,1,false); local nEndPos = String.Find(temp,strFim, nFoundPos + nAnchorLength, false); if(nEndPos ~= -1)then local miolo = String.Mid(temp,nFoundPos+nAnchorLength,nEndPos-(nFoundPos+nAnchorLength)); end return miolo; end -- conteudo = "TCP 0.0.0.0:445 0.0.0.0:0 LISTENING 4 [System] TCP 0.0.0.0:3306 0.0.0.0:0 LISTENING 3864 [mysqld.exe] TCP 127.0.0.1:1025 0.0.0.0:0 LISTENING 1840 [alg.exe]"; teste = fnMiolo(resposta, " 0.0.0.0:3306 ", "]"); teste = fnMiolo(teste .. "]", "[", "]"); result = Dialog.Message("Notice", teste .. " is using the port 80. Should I kill it?", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1); end