Hi ich hab folgendes Problem:
ich bekomme nicht den Namen des gewählten List-Items heraus. Code:
Spoiler anzeigen
#include <GUIConstants.au3>
#Include <File.au3>
#Include <Array.au3>
#include <GuiListBox.au3>
$FileList=_FileListToArray("User\")
[/autoit] [autoit][/autoit] [autoit]GuiCreate("Admin Control",200,100,$WS_EX_CLIENTEDGE)
GuiSetState()
$AddB=GuiCtrlCreateButton("Add",10,10,50,20)
$DelB=GuiCtrlCreateButton("Del",10,30,50,20)
$ConfB=GuiCtrlCreateButton("Conf.",10,70,50,20)
$List=GuiCtrlCreateList("",70,10,120,90)
[/autoit] [autoit][/autoit] [autoit]$count = 0
Do
$count = $count + 1
GUICtrlSetData($List,$FileList[$count])
Until $count = $FileList[0]
While 1
$Msg = GuiGetMsg()
If $Msg=$AddB Then
$Newuser = InputBox("New User","Username:","","",150,50)
if $Newuser = "" then
;nix
Else
AddUser()
EndIf
EndIf
If $Msg=$DelB Then
$Deluser = InputBox("Delete User","Username:","","",150,50)
if $Deluser = "" then
;nix
Else
DelUser()
EndIf
EndIf
If $Msg=$ConfB Then
msgbox(0,"",_GUICtrlListBox_GetSelItemsText($List))
msgbox(0,"",_GUICtrlListBox_GetText($List, 1))
EndIf
Wend
[/autoit] [autoit][/autoit] [autoit]Func AddUser()
if FileExists("User\"&$Newuser&".ini") then
MsgBox(64,"Info","Benutzer '"&$Newuser&"' konnte nicht erstellt werden.")
Else
FileWrite("User\"&$Newuser&".ini","")
MsgBox(64,"Info","Benutzer '"&$Newuser&"' wurde erstellt.")
EndIf
EndFunc
Func DelUser()
if FileExists("User\"&$Deluser&".ini") then
FileDelete("User\"&$Deluser&".ini")
MsgBox(64,"Info","Benutzer '"&$Deluser&"' wurde gelöscht.")
Else
MsgBox(64,"Info","Benutzer '"&$Deluser&"' existiert nicht.")
EndIf
EndFunc