举报
#include <Constants.au3> $foo = Run("a.bat", @ScriptDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) While 1 $line = StdoutRead($foo) If @error Then ExitLoop MsgBox(0,"",$line) WEnd
#include <Constants.au3> $foo = Run("a.bat", @ScriptDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) While 1 $line = StdoutRead($foo) If @error Then ExitLoop GETip($line) WEnd Func GETip($str) If StringInStr($str,"[") Then $arr=StringSplit($str,"[") $arr1=StringSplit($arr[2],"]") $file=FileOpen("ip.txt",1) FileWriteLine($file,$arr1[1]) FileClose($file) EndIf EndFunc
#include <Constants.au3> Local $foo = Run("ping.exe www.baidu.com -n 1", @ScriptDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) Local $sIP = "" Do Sleep(100) $sText = StdoutRead($foo) $sIP = StringRegExpReplace($sText, '(?s)(.*?\[)(\d+.\d+.\d+.\d+)(].*)', '\2') Until $sIP MsgBox(0, "", $sIP) Exit
本版积分规则 发表回复 回帖后跳转到最后一页
|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度
GMT+8, 2025-5-20 07:28 , Processed in 0.090532 second(s), 24 queries .
Powered by Discuz! X3.5 Licensed
© 2001-2025 Discuz! Team.