源码放上。另外论坛发贴时如果将所有内容放到引用中,会提示小于10个字符的限制。
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 501, 324, 306, 240)
$ListView1 = GUICtrlCreateListView("", 8, 8, 482, 302)
_GUICtrlListView_AddColumn($ListView1, "IP", 150)
_GUICtrlListView_AddColumn($ListView1, "状态", 50)
GUICtrlSendMsg($ListView1, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_GRIDLINES, $LVS_EX_GRIDLINES)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
For $i = 1 To 5
$ip = "192.168.0." & $i
$var = Ping($ip, 500)
GUICtrlCreateListViewItem($ip & "|" & $var, $ListView1)
Next
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd |