Что нового

Чтение из ini в [GUICtrlCreateListView]

Zoldan

Новичок
Сообщения
8
Репутация
0
Имеется ini файл пример привел, как считать Patch В [GUICtrlCreateListView] но чтоб вносились все строки, а не только первая?

Код:
[Section]
Patch=E:\TEST1.txt
Patch=E:\TEST2.txt
Patch=E:\TEST3.txt
Patch=E:\TEST4.txt

Код:
$sTest1 = GUICreate("", 600, 380, -1, -1, -1)
$sListView = GUICtrlCreateListView("", 0, 80, 600, 250)
GUISetState(@SW_SHOW, $Test1)	
$Test2 = IniRead(@ScriptDir & "\test.ini", "Section", "Patch", "NotFound")
$Test3 = GUICtrlCreateListViewItem($Test2, $sListView)
 

madmasles

Модератор
Глобальный модератор
Сообщения
7,790
Репутация
2,322
Zoldan
Вы не читаете ответы на Ваши вопросы.
madmasles [?]
но потом обращаться к секции можно будет только через IniReadSection().
Код:
#include <GUIConstantsEx.au3>

$sFileIni = @ScriptDir & '\test.ini'
$sSection = 'Section'
$aSection = IniReadSection($sFileIni, $sSection)

GUICreate('Test', 600, 310)
$nListView = GUICtrlCreateListView(@ScriptDir, 5, 50, 590, 255)
For $i = 1 To $aSection[0][0]
	GUICtrlCreateListViewItem($aSection[$i][1], $nListView)
Next
GUISetState()

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit

	EndSwitch
WEnd
 
Верх