Posted By

iLLUMIN on 11/20/09


Tagged

String delphi


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

Nix


KeyGen


 / Published in: Delphi
 

URL: www.sa1t.ru

Key gen for http://snipplr.com/view/23482/my-variant-enter-licens-key/ Can be some unstable.

  1. unit Unit1;
  2.  
  3. interface
  4.  
  5. uses
  6. Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  7. Dialogs, StdCtrls;
  8.  
  9. type
  10. TForm1 = class(TForm)
  11. Edit1: TEdit;
  12. Button1: TButton;
  13. procedure Button1Click(Sender: TObject);
  14. private
  15. { Private declarations }
  16. public
  17. { Public declarations }
  18. end;
  19.  
  20. var
  21. Form1: TForm1;
  22. q : longint;
  23. w,g,h : string;
  24.  
  25. implementation
  26.  
  27. {$R *.dfm}
  28.  
  29. procedure TForm1.Button1Click(Sender: TObject);
  30. const ak : array [1..11] of char = ( 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K' );
  31. kz : array [1..15] of char = ( 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' );
  32. var key : array [1..14] of char;
  33. begin
  34. Edit1.Text := '';
  35. Randomize;
  36. (* 1 , 10 *)
  37. w := IntToStr(Random(5) + 1);
  38. key[1] := Char(w[1]);
  39. while q < 5 do q := Random(8) + 1;
  40. w := IntToStr(q);
  41. key[10] := Char(w[1]);
  42. (* 2 , 4 *)
  43. q := Random(10) + 1;
  44. key[2] := Char(ak[q]);
  45. q := Random(14) + 1;
  46. key[4]:= Char(kz[q]);
  47. (* 3 , 9 *)
  48. w := IntToStr(Random(5) + 1);
  49. key[3] := Char(w[1]);
  50. key[9] := Char(key[3]);
  51. (* 5 , 8*)
  52. q := Random(2) + 1;
  53. if q = 1 then begin
  54. q := Random(10) + 1;
  55. key[5] := Char(ak[q]);
  56. key[8] := Char(ak[q]);
  57. end;
  58. if q = 2 then begin
  59. q := Random(14) + 1;
  60. key[5] := Char(kz[q]);
  61. key[8] := Char(kz[q]);
  62. end;
  63. (* 6 *)
  64. key[6] := '-';
  65. (* 7 , 11 *)
  66. q := Random(10) + 1;
  67. key[11] := Char(ak[q]);
  68. q := Random(14) + 1;
  69. key[7] := Char(kz[q]);
  70. (* 12 , 13*)
  71. q := Random(10) + 1;
  72. key[12] := Char(ak[q]);
  73. q := Random(14) + 1;
  74. key[13] := Char(kz[q]);
  75. (* 14 ( 1 + 3 ) *)
  76. g := String(key[1]);
  77. h := String(key[3]);
  78. w := IntToStr(StrToInt(g) + StrToInt(h) + 1);
  79. key[14] := Char(w[1]);
  80. (* Enter *)
  81. for q := 1 to 14 do Edit1.Text := Edit1.Text + String(key[q]);
  82. (* Destroy *)
  83. q := 0; w := ''; g := ''; h := '';
  84. end;
  85.  
  86. end.

Report this snippet  

You need to login to post a comment.