home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / r / rkpls301.zip / RKPDEMO2.ZIP / REGISTER.PAS < prev    next >
Pascal/Delphi Source File  |  1993-03-04  |  2KB  |  64 lines

  1. Program Register;
  2.  
  3. {
  4.  This is a sample programme using RkPlus.  It is a sample of a software
  5.  registration programme that would be used by the user to enter their name
  6.  and registration key and create a key file.  This sample will create
  7.  a key file for the Sample1 programme, using a registration key which
  8.  would be generated by the programmer using the GenKey programme.
  9.  
  10.  Register uses the Rkp2Enc unit to cause RkPlus to maintain
  11.  version 2.x/compatible keys.
  12. }
  13.  
  14.  
  15. Uses
  16.   Crt,
  17.   RkPlus,
  18.   Rkp2Enc;
  19.  
  20.  
  21. Const
  22.   MonthNames : Array[1..12] of String[3]
  23.   = ('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
  24.  
  25.  
  26. Var
  27.   kc          : Char;
  28.  
  29.  
  30. Begin
  31.   OwnerCode := 'ArgleBarbWotsLeeb';
  32.   ProgramCode := 'Sample';
  33.   SetKeyFile('Sample');
  34.   WriteLn('Register');
  35.   WriteLn('Software Registration Programme for Sample1');
  36.   WriteLn('See RKPLUS.DOC for more info');
  37.   WriteLn;
  38.   Write('Enter name of person to register : ');
  39.   ReadLn(Rkp.Name1);
  40.   WriteLn;
  41.   Write('Enter the registration key : ');
  42.   ReadLn(Rkp.Key);
  43.   WriteLn;
  44.   Rkp.ID := '(c) Serious Cybernetics';
  45.   Rkp.Message := 'Register';
  46.   Rkp.Name2 := '';
  47.   Rkp.Name3 := '';
  48.   Rkp.Level := 0;
  49.   VerifyKey;
  50.   If Not Rkp.Registered then Begin
  51.     Rkp.Level := 1;
  52.     VerifyKey;
  53.   End;
  54.   If Not Rkp.Registered then
  55.     WriteLn('Invalid key!')
  56.   Else Begin
  57.     SaveRegInfo;
  58.     If RkpOK then
  59.       WriteLn(KeyFileName,' created.')
  60.     Else
  61.       WriteLn('Error ',RkpError,' creating file.');
  62.   End;
  63. End.
  64.