Hi Chris,

My initial thought is that this is something that needs embedded into the
functionality of your program rather than a compile time issue.  Security is
really something that should be addressed as a constituent part of your
design from the start...

However, one relatively quick workaround if you don't want to revisit your
design would be to do the following:

Compile the two versions of your application (with the different compile
conditions) into 2 separate executables.  These executables should not run
unless a particular 'code' (known only to you as a developer) is passed as a
command line parameter.

Create a 'launcher' executable, which is responsible for asking the user for
the passcode.  Your launcher should use this passcode to determine the
correct code to pass on the command line that it then uses to launch one of
your two existing executables via CreateProcess or ShellExecute.

You can make your security check (i.e. the code you pass on the command
line) as complicated as you like, I suppose; ultimately, it depends on how
determined your users are likely to be in terms of trying to get around your
restrictions.

Hope this makes sense.  Any questions, drop me a line.

Cheers,

Conor

-----Original Message-----
From: Chris Veale [mailto:[EMAIL PROTECTED]]

I want to implement something like a passcode that when entered allows the
user to do something different than a user without that passcode.  I have
all the functionality already in the code with compile conditions but from
all the help Ive looked through, I cant change this on the fly - it takes a
full recompile.

Is there any way of allowing this change at runtime using compile conditions
or am I going to have to rebuild the functionality with if statements?
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/

Reply via email to