回复 7# ac5474012
#include <date.au3>
#include <GuiListView.au3>
Global $inifile = @ScriptDir & "\id.ini"
$Form1 = GUICreate("Form1", 433, 510)
$Input1 = GUICtrlCreateInput("1", 56, 72, 137, 21)
$Input2 = GUICtrlCreateInput("2", 56, 120, 137, 21)
$Button = GUICtrlCreateButton("确认", 224, 96, 75, 25)
$ListView = GUICtrlCreateListView("", 56, 216, 330, 254)
_GUICtrlListView_AddColumn($ListView, "时间", 170)
_GUICtrlListView_AddColumn($ListView, "ID号", 150)
Ini()
GUISetState()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case -3
Exit
Case $Button
$sText1 = GUICtrlRead($Input1)
$sText2 = GUICtrlRead($Input2)
If $sText1 <> '' Or $sText2 <> '' Then
If $sText1 = $sText2 Then
GUICtrlCreateListViewItem(_NowCalc() & '|' & $sText1, $ListView)
IniWrite($inifile, "全部",_NowCalc() , $sText1)
EndIf
EndIf
EndSwitch
WEnd
Func ini()
;_GUICtrlListView_DeleteAllItems($ListView)
$array = IniReadSection($inifile, "全部")
If @error Then
GUICtrlCreateListViewItem("INI文件不存在或文件无内容", $ListView)
Else
For $i = 1 To $array[0][0]
GUICtrlCreateListViewItem($array[$i][0] & "|" & $array[$i][1], $ListView)
Next
EndIf
EndFunc ;==>ini
|