Jump to content

Recommended Posts

Posted (edited)

It Errors out on $BS_AUTOCHECKBOX

Why?

#include <GUIConstants.au3>
#include <string.au3>

dim $save
dim $user
dim $password
dim $ufill = IniRead("C:\Documents and Settings\BDelanghe\Desktop\09tk79.ini", "section1", "key", "")
$ufill = _StringEncrypt ( 0, $ufill, "redtail" , 1 )
dim $pfill = IniRead("C:\Documents and Settings\BDelanghe\Desktop\09tk79.ini", "section1", "key2", "")
$pfill = _StringEncrypt ( 0, $pfill, "redtail" , 1 )

$msg = GUICreate("Login to SAI", 270, 120)
GUICtrlCreateLabel("Username:", 30, 10,90,-1)
GUICtrlCreateInput ( $ufill, 100, 10,150) 
GUICtrlCreateLabel("Password:", 30, 40)
GUICtrlCreateInput ( $pfill, 100, 40,150,-1,$ES_PASSWORD) 
$login = GUICtrlCreateButton("Log In", 100, 90, 80,-1,$BS_DEFPUSHBUTTON )
GUICtrlCreateCheckbox ( "Save my username/password.",30,62,-1,-1,$BS_AUTOCHECKBOX);;<--It wont let me use;;$BS_AUTOCHECKBOX
If $ufill = "" Then
        GUICtrlSetState ( 8, $GUI_UNCHECKED )
Else
    GUICtrlSetState ( 8, $GUI_CHECKED )
endif
GuiSetState()

While 1
  $msg = GUIGetMsg()

  Select

    Case $msg = $GUI_EVENT_CLOSE
    GUIDelete ()
    Exit
    Exitloop

    Case $msg = $login
    $user = GUICtrlRead ( 4 )
    $password = GUICtrlRead ( 6 )
    If $user = "" OR $password = "" Then
     MsgBox (262160,"Error","No Username/Password.")
    ContinueLoop
    Else    
    $save = GUICtrlRead (8)
    Call ("save")
    GUIDelete ()
    EndIf
    ExitLoop
  EndSelect
WEnd 

func save()
  If $save = "1" Then
    $euser = _StringEncrypt ( 1, $user, "redtail" , 1 )
    IniWrite("C:\Documents and Settings\BDelanghe\Desktop\09tk79.ini", "section1", "key", $euser)
    $epassword = _StringEncrypt ( 1, $password, "redtail" , 1 )
    IniWrite("C:\Documents and Settings\BDelanghe\Desktop\09tk79.ini", "section1", "key2", $epassword)
    Else
    IniDelete("C:\Documents and Settings\BDelanghe\Desktop\09tk79.ini", "section1", "key")
    IniDelete("C:\Documents and Settings\BDelanghe\Desktop\09tk79.ini", "section1", "key2")
    
  EndIf
Endfunc
Edited by skafreak_510

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
×
×
  • Create New...