找回密码
 加入
搜索
查看: 1548|回复: 2

检查的内容如何从list1中显示出来。

[复制链接]
发表于 2008-10-27 15:22:02 | 显示全部楼层 |阅读模式
检查的内容如何从list1中显示出来。但不打开DOS窗口

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListBoxConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("David科大内部测试", 413, 300, 362, 183)
$List1 = GUICtrlCreateList("", 40, 112, 121, 136)
$List2 = GUICtrlCreateList("", 224, 112, 121, 136)
$Button1 = GUICtrlCreateButton("检查网关", 56, 48, 73, 33, 0)
$Button2 = GUICtrlCreateButton("检查外网", 248, 48, 73, 33, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
Case $Button1
RunWait("ping 10.1.40.1 "); 打开ping
Case $Button2
RunWait("ping www.baidu.com "); 打开ping

        EndSwitch
WEnd
发表于 2008-10-27 15:44:54 | 显示全部楼层

#include <Constants.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListBoxConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("David科大内部测试", 413, 300, 362, 183)
$List1 = GUICtrlCreateList("", 40, 112, 121, 136)
$List2 = GUICtrlCreateList("", 224, 112, 121, 136)
$Button1 = GUICtrlCreateButton("检查网关", 56, 48, 73, 33, 0)
$Button2 = GUICtrlCreateButton("检查外网", 248, 48, 73, 33, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button1
                        $run = Run(@ComSpec & " /c ping 10.1.40.1", '', @SW_HIDE, $STDOUT_CHILD); 打开ping
                        ProcessWaitClose($run)
                        $string = StdoutRead($run)
                        MsgBox(0,'',$string)
                        $string = StringRegExpReplace($string, '\n', '|', 0)
                        GUICtrlSetData($List1, $string)
                Case $Button2
                        $run = Run(@ComSpec & " /c ping www.baidu.com", '', @SW_HIDE, $STDOUT_CHILD); 打开ping
                        ProcessWaitClose($run)
                        $string = StdoutRead($run)
                        MsgBox(0,'',$string)
                        $string = StringRegExpReplace($string, '\n', '|', 0)
                        GUICtrlSetData($List2, $string)
        EndSwitch
WEnd
 楼主| 发表于 2008-10-27 21:04:07 | 显示全部楼层
谢谢

我是刚开学。好多代码还没有看明白。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-6-16 17:12 , Processed in 0.079954 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表