Wenn du nur numerische Serials verwenden willst, hab ich was einfaches fertiges:
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51:
| procedure TForm1.Starte_UeberpruefungClick(Sender: TObject); var a, b, I: Integer; c: Double; Echt: Boolean; begin Echt := True; a := 0; For I := 1 to Length(Edit1.Text) do a := a + Ord(Edit1.Text[I]); b := 0; For I := 1 to Length(Edit2.Text) do b := b + Ord(Edit2.Text[I]); c := a*b; For I := 1 to Round((Length(Edit1.Text) + Length(Edit2.Text))/2) do if Length(Edit3.Text)>=I then begin c := c*pi*I*I; Repeat c := c/10; Until c<11; if c>=10 then c := 0; if Edit3.Text[I]<>IntToStr(Round(c)) then Echt := False; end; if not Echt then MessageDlg('FALSCH !', mtError, [mbOK], 0); end;
procedure TForm1.Lese_Serial_ausClick(Sender: TObject); var a, b, I: Integer; c: Double; begin Edit3.Clear; a := 0; For I := 1 to Length(Edit1.Text) do a := a + Ord(Edit1.Text[I]); b := 0; For I := 1 to Length(Edit2.Text) do b := b + Ord(Edit2.Text[I]); c := a*b; For I := 1 to Round((Length(Edit1.Text) + Length(Edit2.Text))/2) do begin c := c*pi*I*I; Repeat c := c/10; Until c<11; if c>=10 then c := 0; Edit3.Text := Edit3.Text + IntToStr(Round(c)); end; end; |
Du brauchst dazu natürlich Edit1, Edit2, Edit3 und 2 Buttons... !
1 zum überprüfen und 1 um dir die Serials generieren zu lassen !
Viele Grüsse.