本帖最后由 nuoyan 于 2021-9-17 13:04 编辑
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>
#include <array.au3>
#include <File.au3>
#include <Array.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 220, 395)
$ListView1 = GUICtrlCreateListView("row", 30, 20, 156, 326)
$ListView1_0 = GUICtrlCreateListViewItem("a", $ListView1)
$ListView1_1 = GUICtrlCreateListViewItem("b", $ListView1)
$ListView1_2 = GUICtrlCreateListViewItem("c", $ListView1)
$ListView1_3 = GUICtrlCreateListViewItem("d", $ListView1)
$ListView1_4 = GUICtrlCreateListViewItem("e", $ListView1)
$Button1 = GUICtrlCreateButton("确定", 70, 355, 65, 21)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
Local $aArray[_GUICtrlListView_GetItemCount($ListView1)][_GUICtrlListView_GetColumnCount($ListView1)]
For $i = 0 To _GUICtrlListView_GetItemCount($ListView1) - 1
Local $aItem = _GUICtrlListView_GetItemTextArray($ListView1, $i)
For $j = 1 To UBound($aItem) - 1
$aArray[$i][$j - 1] = $aItem[$j]
Next
Next
IniWrite(@ScriptDir & "\111.ini", "111", "222", _ArrayToString($aArray, "", 0, UBound($aArray) - 1))
EndSwitch
WEnd
请教下如何将写入到ini文件的格式变成以下效果:
[111]
222=a,b,c,d,e
|