IniRead problem

06/26/2010 13:24 Syst3m Down#1
Hab mich weiter durch etliche tuts gequält auch in nem autoit forum gefragt aber so richtig bekommt keiner das hin

also der fehler liegt glaub bei der Ini Read aber ich kriegs einfach nicht raus
06/26/2010 13:50 bladerofdarknes#2
das problem liegt doch auf der hand:

Quote:
$ini = "config.ini"
$iniread = IniRead($ini,"Nutzung","ja/nein","ja","NotFound")
If $iniread = "ja" Then
$name = IniRead($ini,"Login","Name")
$pw = IniRead($ini,"Login","PW")
du liest aus einer .ini die garnicht existiert, du solltest zuerst ein gui machen mit inputboxen und diese dann auslesen und in die ini schreiben,

Quote:
$read1=GuiCTRLRead($Input1)
Iniwrite("config.ini", "Nutzung", "ja/nein", $read1)
so in der art sollte es aussehen, falls dir das nicht weiter hilft in meinem source release wird sehr viel mit iniread und iniwrite gearbeitet! [Only registered and activated users can see links. Click Here To Register...]
06/26/2010 14:40 Syst3m Down#3
kann auch geclosed werden problem wurde gefixt bevor ich deins gelesen habe aber danke für deine mühe
08/11/2010 11:07 böserjunge#4
hi leute ich hätte da noch ne Frage wie man jetz zum beispiel macht dass man sich einloggen muss und so mit allem drum und dran dass er passwort und benutzer aus der .ini datei liest und dann kontrolliert??
bitte nich zu kompliziert antworten bin n ziemlicher NoOb
Danke schon im voraus!
08/11/2010 12:09 DraaaKe#5
Quote:
Originally Posted by böserjunge View Post
hi leute ich hätte da noch ne Frage wie man jetz zum beispiel macht dass man sich einloggen muss und so mit allem drum und dran dass er passwort und benutzer aus der .ini datei liest und dann kontrolliert??
bitte nich zu kompliziert antworten bin n ziemlicher NoOb
Danke schon im voraus!

So also ich schreib dir maal ein Beispiel:

[CODE]$Passwort = Iniread("DeineIni.ini","Accountdaten","Passwort",1 )
$ID = IniRead("DeineIni.Ini","Accountdaten","ID",1)
Dann brauchst du halt eine GUI mit 2 Inputs und einem Okay Button, bzw noch einem abbrechen Button. Dann leitest du den Okay Button zur Funktion OKAY

Func OKAY()
$Input1Auslesen = GuiCtrlRead($Input1)
$Input2Auslesen = GuiCtrlRead($Input2)
If $Input1Auslesen = $ID and $Input2Auslesen = $Passwort Then
Guidelete($LoginGUI)
EigentlicheFunktion(); hier leitest du dann auf dein Programm weiter
Else
Msgbox(0,"Error","Deine Eingaben stimmen nicht!")
Endif
Endfunc

Ich werde das nachher noch schöner schreiben weil ich gerade am iPod schreibe.
08/11/2010 17:06 böserjunge#6
und wie siht des dann aus wenn auch mehrere user sich anmelden können sollen?
also bei mir sieht des jetz ungefähr so aus: (nich wundern isn verhau und noch nich fertig)

Quote:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Include <File.au3>


$richtigstat=IniRead("statistik.ini", "stats", "richtig",0)
$falschstat=IniRead("statistik.ini", "stats", "falsch",0)


#Region ### START Koda GUI section ### Form=c:\program files\autoit3\scite\koda\forms\vokabel.kxf
$Form1_1 = GUICreate("Erstmal Anmelden...", 450, 250, 286, 127,-1, 0x10)
GUISetBkColor(0x808080)
$file = GUICtrlCreateGroup("Bitte Benutzernamen eingeben", 8, 8, 337, 57)
$i_benutzer = GUICtrlCreateInput("", 24, 30, 217, 21)
guictrlsetstate(-1,8)
$b_pwforgot = GUICtrlCreateButton("Passwort vergessen", 320, 95, 110, 35, $WS_GROUP)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group1 = GUICtrlCreateGroup("Bitte passwort eingeben", 8, 80, 300, 57)
$i_Input2 = GUICtrlCreateInput("", 24, 104, 217, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Pic1 = GUICtrlCreatePic("C:\Dokumente und Einstellungen\Schmidt\Desktop\Spiele\vokabeltraine r\Daumen hoch.jpg", 70, 155, 40, 36, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$Pic1 = GUICtrlCreatePic("C:\Dokumente und Einstellungen\Schmidt\Desktop\Spiele\vokabeltraine r\Daumen hoch.jpg", 285, 155, 40, 36, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$b_regist = GUICtrlCreateButton("Jetzt Registrieren", 110, 155, 175, 38, $WS_GROUP)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$b_weiter = GUICtrlCreateButton("Weiter zum Vokabeltrainer", 250, 210, 170, 25, $WS_GROUP)
$b_abbrechen = GUICtrlCreateButton("Abbrechen", 40, 210, 75, 25, $WS_GROUP)

GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###



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

#include <GUIConstants.au3>

Opt("GUIDataSeparatorChar", "")
#Region ### START Koda GUI section ### Form=
$pwforgot = GUICreate("Passwort vergessen", 420, 368, 347, 343)
GUISetIcon("D:\009.ico")
$GroupBox1 = GUICtrlCreateGroup("", 14, 22, 375, 281)
$Label1 = GUICtrlCreateLabel("Geben sie ihren Benutzernamen ein", 106, 38, 172, 17)
GUICtrlCreateInput("", 135, 64, 121, 21)
$Label2 = GUICtrlCreateLabel("Was war ihre Sicherheitsfrage bei der Registrierung?", 17, 100, 251, 17)
$Label3 = GUICtrlCreateLabel("Antwort:", 294, 146, 43, 17)
GUICtrlCreateInput("", 255, 195, 121, 21)
GUICtrlCreateRadio("Wann ist ihr Geburtstag?", 26, 126, 139, 17)
GUICtrlCreateRadio("Was ist ihr Lieblingstier?", 26, 147, 139, 17)
GUICtrlCreateRadio("Wie ist der Name ihrer Mutter?", 26, 168, 166, 17)
GUICtrlCreateRadio("Wie ist der Name ihres Vaters?", 26, 189, 177, 19)
GUICtrlCreateRadio("Was ist ihre große Angst?", 27, 278, 144, 17)
GUICtrlCreateRadio("Was ist ihr zweiter Name?", 27, 256, 155, 17)
GUICtrlCreateRadio("Wie heißt ihr Haustier?", 26, 212, 139, 17)
GUICtrlCreateRadio("Was ist ihre große Liebe?", 27, 235, 139, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$weiter = GUICtrlCreateButton("Weiter>>>", 304, 330, 75, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

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

Case $weiter
check()
[CODE]$Passwort = Iniread("DeineIni.ini","Accountdaten","Passwort",1 )
$ID = IniRead("config.ini","Accountdaten","ID",1)
MsgBox ( 64, "Ihr Passwort ist: " & $i_Input2 )
EndSwitch
WEnd








case $b_regist
#include <GUIConstants.au3>

Opt("GUIDataSeparatorChar", "")
#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Form2", 454, 666, 372, 249)
$Group0 = GUICtrlCreateGroup("Geben sie ihren gewünschten Benutzernamen ein", 18, 25, 287, 105)
$benutzer = GUICtrlCreateInput("", 31, 68, 250, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)
checkit()
$Label1 = GUICtrlCreateLabel("frei", 330, 69, 32, 20)
GUICtrlSetFont(-1, 10, 800, 0, "Swis721 Blk BT")
GUICtrlSetColor(-1, 0x00FF00)
$Label2 = GUICtrlCreateLabel("vergeben", 315, 70, 66, 18)
GUICtrlSetFont(-1, 8, 800, 0, "Swis721 Blk BT")
GUICtrlSetColor(-1, 0xFF0000)
$Group1 = GUICtrlCreateGroup("Geben sie ihr gewünschtes Passwort ein (mid. 6 Buchstaben)", 19, 142, 320, 142)
$passw = GUICtrlCreateInput("", 40, 186, 272, 21)
$passw2 = GUICtrlCreateInput("", 42, 243, 270, 21)
$Label3 = GUICtrlCreateLabel("Passwort wiederholen...", 47, 218, 116, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("Sicherheitsfrage wählen (falls sie ihr Passwort vergessen)", 29, 321, 375, 281)
$Label6 = GUICtrlCreateLabel("Antwort:", 300, 406, 43, 17)
GUICtrlCreateInput("", 269, 477, 121, 21)
GUICtrlCreateRadio("Wann ist ihr Geburtstag?", 40, 370, 139, 17)
GUICtrlCreateRadio("Was ist ihr Lieblingstier?", 40, 394, 139, 17)
GUICtrlCreateRadio("Wie ist der Name ihrer Mutter?", 40, 417, 166, 17)
GUICtrlCreateRadio("Wie ist der Name ihres Vaters?", 40, 442, 177, 19)
GUICtrlCreateRadio("Was ist ihre große Angst?", 42, 546, 144, 17)
GUICtrlCreateRadio("Was ist ihr zweiter Name?", 41, 520, 155, 17)
GUICtrlCreateRadio("Wie heißt ihr Haustier?", 40, 469, 139, 17)
GUICtrlCreateRadio("Was ist ihre große Liebe?", 41, 495, 139, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button1 = GUICtrlCreateButton("Fortfahren>>>", 318, 622, 96, 29, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

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

Case $Button1
checkpw()

EndSwitch
WEnd


Case $inidelete
IniWrite("statistik.ini", "stats", "richtig", 0)
quote()
IniWrite("statistik.ini", "stats", "falsch", 0)
quote()
MsgBox ( 64, "löschen erfolgreich", "löschen war erfolgreich!" )
Case $loesung
MsgBox ( 48, "lösung", "Die richtige Lösung wäre " & $word[2] & " gewesen" )
$falschstat +=1
IniWrite("statistik.ini", "stats", "falsch", $falschstat)
quote()
guictrlsetdata($Input3,"")
vokabel()



EndSwitch
WEnd


[CODE]$Passwort = Iniread("DeineIni.ini","Accountdaten","Passwort",1 )
$ID = IniRead("config.ini","Accountdaten","ID",1)


Func OKAY()
$Input1Auslesen = GuiCtrlRead($Input1)
$Input2Auslesen = GuiCtrlRead($Input2)
If $Input1Auslesen = $ID and $Input2Auslesen = $Passwort Then
Guidelete($LoginGUI)
EigentlicheFunktion(); hier leitest du dann auf dein Programm weiter
Else
Msgbox(0,"Error","Deine Eingaben stimmen nicht!")
Endif
Endfunc
08/12/2010 11:03 böserjunge#7
isses vllt. so richtig?
PHP Code:
Case $weiter
    $Passwort 
Iniread("config.ini","Accountdaten","Passwort",$123 )
    
$ID IniRead("config.ini","Accountdaten","ID",$1234)
    Do $
123 +=And $1234 +=1 Until $123 $benutz123
    MsgBox 
64"Ihr Passwort ist: " &  $1234 )
EndSwitch
WEnd 
08/13/2010 12:16 böserjunge#8
bitte um Antworten pls!