home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-387-Vol-3of3.iso
/
r
/
rkpls301.zip
/
RKPDEMO3.ZIP
/
GENFILE.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-03-04
|
2KB
|
88 lines
Program GenFile;
{
This is a sample programme using RkPlus. It is a sample of a key file
generation programme that would be used by the programmer to create
key files to be distributed to registered users. The programme itself
would NOT be distributed, as it would allow users to generate key
files. This sample can create a limited use Sample key file or full
registration key file, for the Sample1 and Sample2 programmes.
GenFile uses the Rkp3Enc unit to cause RkPlus use the new version 3.x
keys.
}
Uses
Crt,
Dos,
RkPlus,
Rkp3Enc;
Const
MonthNames : Array[1..12] of String[3]
= ('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
Var
kc : Char;
ey,em,dd,dw : Word;
Owner : Array[0..16] of Char;
Prog : Array[0..5] of Char;
Ver : Real;
Begin
Owner := 'ArgleBarbWotsLeeb';
Prog := 'Sample';
Ver := 1.0;
SetOwnerCode(Owner,SizeOf(Owner));
SetProgCode(Prog,SizeOf(Prog));
SetVerCode(Ver,SizeOf(Ver));
SetKeyFile('Sample');
WriteLn('GenFile');
WriteLn('Key File Generation Programme for Sample1/Sample2');
WriteLn('See RKPLUS.DOC for more info');
WriteLn;
WriteLn('GenFile would be used by the programmer to create key files.');
WriteLn('It would NOT be distributed.');
WriteLn;
Write('Enter name of person to register : ');
ReadLn(Rkp.Name1);
WriteLn;
Write('Is this a limited use demo? ');
kc := UpCase(ReadKey);
WriteLn(kc);
WriteLn;
If (kc in ['Y','y']) then Begin
GetDate(ey,em,dd,dw);
If (em = 12) then Begin
em := 1;
Inc(ey);
End Else
Inc(em);
WriteLn('Creating limited use demo key (will expire 1-',MonthNames[em],'-',ey,')');
Rkp.Level := 0;
Rkp.ExpYear := ey;
Rkp.ExpMonth := em;
Rkp.ExpDay := 1;
End Else Begin
WriteLn('Creating unlimited registration key');
Rkp.Level := 1;
Rkp.ExpYear := 0;
Rkp.ExpMonth := 0;
Rkp.ExpDay := 0;
End;
Rkp.ID := '(c) Serious Cybernetics';
Rkp.Message := 'GenFile';
Rkp.Name2 := '';
Rkp.Name3 := '';
CreateKey;
SaveRegInfo;
If Rkp.Registered then
WriteLn(KeyFileName,' created.')
Else
WriteLn('Error ',RkpError,' creating file.');
End.