Jump to content
Sign in to follow this  
VerteXslaPPy

Save my Ctrlinput into a .txt file

Recommended Posts

 Hello, i want that my Login save my Username and Password

$hInput_Benutzername = GUICtrlCreateInput("", 70, 12, 210, 21)
$hInput_Passwort = GUICtrlCreateInput("", 70, 36, 210, 21, $ES_PASSWORD)
what i tried :
$filetxt = FileOpen(@ScriptDir & "\login.txt", 2)
Case $hButton_Login
           If _IsChecked($savelogin) Then
                  FileWrite($filetxt, $hInput_Benutzername & @CRLF)
                  FileWrite($filetxt, $hInput_Benutzername)
                 EndIf
 

 

Edited by VerteXslaPPy

Share this post


Link to post
Share on other sites

Use GuiCtrlRead() to get the value of the control.

Jos

Share this post


Link to post
Share on other sites

i used now this :

$hInput_Benutzername = GUICtrlCreateInput(-->$lol1<--, 70, 12, 210, 21)
$hInput_Passwort = GUICtrlCreateInput(-->$lol2<--, 70, 36, 210, 21, $ES_PASSWORD)

Case $hButton_Login
           If _IsChecked($savelogin) Then
              $lol1 = GUICTRLREAD($hInput_Benutzername)
              $lol2 = GUICTRLREAD($hInput_Passwort)
                  FileWrite($filetxt, $lol1 & @CRLF)
                  FileWrite($filetxt, $lol2)

                 EndIf

 

 

but how i use $lol1 and $lol2 now in the Input Boxes?

 

sorry but how i use correctly IniRead to read perfect from line 1 and iniread to read from line 2?

 

thats should be do an simple save login

 

sorry for my bad english

Edited by VerteXslaPPy

Share this post


Link to post
Share on other sites

Something close to this:

$lol1 = IniRead($filetxt, "Main", "Userid", "")
$lol2 = IniRead($filetxt, "Main", "Password", "")
$hInput_Benutzername = GUICtrlCreateInput($lol1, 70, 12, 210, 21)
$hInput_Passwort = GUICtrlCreateInput($lol2, 70, 36, 210, 21, $ES_PASSWORD)

Case $hButton_Login
    If _IsChecked($savelogin) Then
        $lol1 = GUICtrlRead($hInput_Benutzername)
        $lol2 = GUICtrlRead($hInput_Passwort)
        IniWrite($filetxt, "Main", "Userid", $lol1)
        IniWrite($filetxt, "Main", "Password", $lol2)
    EndIf

Jos

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...