Jump to content

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
Link to comment
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
Link to comment
Share on other sites

  • Developers

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

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...