關(guān)閉進程運行的 STDIO 重定向所有資源.
StdioClose ( 進程 id )
進程 ID | 子進程 ID, 由先前調(diào)用的 Run 返回. |
成功: | 返回非零值. |
失敗: | 返回 0, 進程沒有 STDIO 重定向或已關(guān)閉. |
; 演示 StdioClose()
#include <Constants.au3>
Local $pid
= Run(@ComSpec & " /c dir
foo.bar", @SystemDir, @SW_HIDE, $STDERR_MERGED + $STDOUT_CHILD)
StdioClose($pid)
; 不會讀任何數(shù)據(jù),因為已關(guān)閉了所有將取數(shù)據(jù)的流.
Local $line
While 1
$line
= StdoutRead($pid)
If
@error Then
ExitLoop
MsgBox(0, "STDOUT
讀取:", $line)
WEnd
While 1
$line
= StderrRead($pid)
If
@error Then
ExitLoop
MsgBox(0, "STDERR
讀取:", $line)
WEnd
MsgBox(0, "調(diào)試", "準備退出...")
provider with jb51.net (unicode) |