Contents - Index - Previous - Next


TZipMaster.GetPassword


 

TZipMaster See also: Note on passwords:

The GetPassword method will ask the user for a password.

Function GetPassword( DialogCaption, MsgTxt ; pwb: TPasswordButtons: String, var ResultStr: String ) : TPasswordButton;

Description:

Prompt the user for a password. The password will only be asked once. It will not automatically be saved in the Password property.

You can set the caption and message text of this password dialog yourself or get the language dependend text from the resource file like:

ZipMaster1.GetPassword( LoadStr( PW_Caption ), LoadStr( PW_MessageEnter ) + ': for file ' + ForFile, NewPassword );

or

ZipMaster1.GetPassword( LoadStr( PW_Caption ), LoadStr( PW_MessageVerify ), NewPassword );

pwButtons is a set of buttons indicating the buttons that will be shown in the password dialog.

Possible values are: pwbOk, pwbCancel, pwbCancelAll and pwbAbort. Default and always present is: pwbOk.

 

The return value of this method is set to the button pressed and ResultStr is set to the password the user entered.

The button text on this dialog is taken from the chosen resource file and as such language dependent.

 

You can use this method in the OnPasswordError event to get a new or different password from the user.