home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of Shareware - Software Farm 2
/
wosw_2.zip
/
wosw_2
/
PASCAL
/
RKPLUS31.ZIP
/
RKPDEMO.ZIP
/
GENFILE.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-06-15
|
2KB
|
79 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 example encoding unit Encode.
}
Uses
Crt,
Dos,
RkPlus,
Encode;
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;
Begin
SetProgID('Sample');
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 := 0;
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.