Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

password for a program

I was wondering how I could make a program that is protected with a password. So that you have to enter the password every time you use it. Thanks,
Rhiannon

Comments

  • zibadianzibadian Member Posts: 6,349
    : I was wondering how I could make a program that is protected with a password. So that you have to enter the password every time you use it. Thanks,
    : Rhiannon
    :
    There are many good examples on this board, but here is a very simple one:
    [code]
    procedure TForm1.FormCreate(Sender: TObject);
    begin
    if Input('Password check','Enter password','')<>'password' then
    Close;
    end;
    [/code]
  • danmafteidanmaftei Member Posts: 5
    : I was wondering how I could make a program that is protected with a password. So that you have to enter the password every time you use it. Thanks,
    : Rhiannon
    :

    Try something like that:
    From File->New just add a PasswordDialog to your project (Borland put it there for this reason) and make it the default form for the project.
    Then choose a password for running the application, of the onclick event of the OKbtn of the password dialog write the followingcode:

    [blue]procedure [black]TPasswordDlg.OKBtnClick(Sender: TObject);
    [blue]begin
    if [black]password.Text <>[green]'password'[blue] then [blue]close
    [blue]else [blue]begin
    [black]PasswordDialog.Hide;
    Form1.Show;
    [blue]end;
    [blue]end;
    [black]
    (assuming that your current main form if Form1 and the password choosen is [red]password[black])
    Doing this, you can specify the passwordchar (*) for the password or make it invisible making the space it's passwordchar.
    I think that's it! If you encounter problems doing it just send me an e-mail (danm@home.ro). Good Luck!

  • ParadigmParadigm Member Posts: 77
    Hi all and danmaftei,

    Just like to know whether we can change the password when the program is running. That is after the correct passwod had been entered. Then providing another option to change the current password so that when u log on next time, the new password will be in used.

    Don't know whether this is possible or not.

    Thanks

    Regards,
    Para

  • zibadianzibadian Member Posts: 6,349
    : Hi all and danmaftei,
    :
    : Just like to know whether we can change the password when the program is running. That is after the correct passwod had been entered. Then providing another option to change the current password so that when u log on next time, the new password will be in used.
    :
    : Don't know whether this is possible or not.
    :
    : Thanks
    :
    : Regards,
    : Para
    :
    :
    You can always save the password in a different file or in the registry. Then your program can update it whenever necessary.
  • liudmilliudmil Member Posts: 21
    mail me at
    loop@iservice.bg

    I'll send you the source af a component, written by me for my projects, wich do all that job for you.


  • Chris BrownChris Brown USAMember Posts: 4,496 ✭✭

    _______ [ http://forcoder.org ] free video tutorials and ebooks about // Perl, Objective-C, Assembly, Visual Basic, C++, Delphi, Swift, R, Python, Visual Basic .NET, PL/SQL, MATLAB, C, Scratch, Go, C#, Ruby, JavaScript, Java, PHP FoxPro, Scheme, Rust, Alice, Hack, Erlang, Clojure, ML, Crystal, Apex, Scala, Transact-SQL, Julia, D, Ada, LabVIEW, Logo, Prolog, Awk, SAS, VBScript, Kotlin, F#, COBOL, Dart, Lisp, ABAP, Lua, Bash, Fortran // _

Sign In or Register to comment.