AutoIt的 - 阅读从控制台的Java异常

问题描述 投票:-1回答:1

我希望能够输出命令行输入到AutoIt的GUI,我已经成功地做了的结果。此命令包含Java调用。

不幸的是,我不能够把可能的Java异常,如:

10:20:10313 INFO - 启动从0.0.0.0/0.0.0.0:0到122.168.11.129:2900连接

storescu:连接超时:连接java.net.ConnectException:连接超时ol.connect0(本机方法)

从我赛特窗口的我的GUI控制台。我已经试过所有谷歌给了我关于consoleRead()函数,这似乎并没有工作。

这是我的代码部分:

Func SendData()
    local $value    = GUICtrlRead($targets)
    local $target   = StringRegExpReplace($value,".*\(","")
    $target         = StringRegExpReplace($target,"\).*","")
    local $trsyntax = StringTrimLeft($value, StringInStr($value,"="))
    local $dcm4che  = GUICtrlRead($dcm4cheGUI)
    local $path     = GUICtrlRead($pathGUI)

    $command = "java -cp .\etc\storescu\;.\etc\certs;.\lib\* org.dcm4che3.tool.storescu.StoreSCU -c " & $target & " " & $path
    $cmd     = Run($command, $dcm4che,@SW_HIDE, 2)

    While True
        $sTMP = StdoutRead($cmd, False, False)
        If @error Then
            ExitLoop 1
        ElseIf $sTMP Then
            $sSTD &= $sTMP
            GUICtrlSetData($eOutput, $sTMP, 1)
        EndIf
        Sleep(100)
    WEnd
EndFunc

该GUICtrlSetData输出一切都变成了巨大的,不可编辑的编辑字段,GUI配置:

GUICreate("SCU Testing Utility", 750, 750, (@DesktopWidth-750)/2, (@DesktopHeight-750)/2, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS, $WS_EX_ACCEPTFILES)
GUICtrlCreateLabel("Sending Target: ", 25, 13, 100, 25)
$targets = GUICtrlCreateCombo("", 125, 10, 600, 30)

GUICtrlCreateLabel("dcm4che Path: ", 25, 46, 100, 25)
$dcm4cheGUI = GUICtrlCreateInput("C:\dcm4che-5.10.5", 125, 40, 600, 25)

GUICtrlCreateLabel("File/Folder to send: ", 25, 81, 100, 25)
$pathGUI = GUICtrlCreateInput("", 125, 75, 600, 25)
GUICtrlSetState (-1, $GUI_DROPACCEPTED)

GUICtrlCreateLabel("Set Path: ", 25, 110, 100, 25)

$filebutton   = GUICtrlCreateButton("File", 125, 105, 300, 25)
$folderbutton = GUICtrlCreateButton("Folder", 425, 105, 300, 25)
$eOutput      = GuiCtrlCreateEdit("", 0, 135, 750, 585, BitOR($ES_WANTRETURN, $WS_VSCROLL, $WS_HSCROLL, $ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_READONLY))

$close = GUICtrlCreateButton("Close", 0, 720, 375, 30)
$send  = GUICtrlCreateButton("Send", 375, 720, 375, 30)
java exception command-line command autoit
1个回答
0
投票

好吧,我知道了,我不得不从2提高标志

$ STDERR_MERGED(0x8中)=提供对STDOUT和STDERR相同的句柄。隐含了$ STDOUT_CHILD和$ STDERR_CHILD。

© www.soinside.com 2019 - 2024. All rights reserved.