i need help with reading data from ini
when i open file it returns me 1 and not content of file
here is script
and here is ini file
[Only registered and activated users can see links. Click Here To Register...]
when i open file it returns me 1 and not content of file
here is script
Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <WindowsConstants.au3>
#include <File.au3>
#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Form1", 516, 419, 193, 124)
$List1 = GUICtrlCreateList("", 8, 8, 289, 396)
$Button1 = GUICtrlCreateButton("Open file", 312, 8, 193, 33)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
$file = FileOpen("C:\Temp\ItemTemplateAll.ini", 0)
; Check if file opened for reading OK
If $file = -1 Then
MsgBox(0, "Error", "Unable to open file.")
Exit
Else
$List1 = GUICtrlSetData($List1, $file & @CRLF)
EndIf
EndSwitch
WEnd
[Only registered and activated users can see links. Click Here To Register...]