频道分类

Delphi 实现最简单的注册机

作者:admin 来源: 日期:2019/10/30 14:49:20 人气: 标签:

 

 

 unit Unit1;

 

interface

 

uses

  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,

  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;

 

type

  TForm1 = class(TForm)

    Label1: TLabel;

    Label2: TLabel;

    Edit1: TEdit;

    Edit2: TEdit;

    procedure Edit1KeyPress(Sender: TObject; var Key: Char);

  private

    { Private declarations }

  public

    { Public declarations }

  end;

 

var

  Form1: TForm1;

  result:integer;

 

 

implementation

 

{$R *.dfm}

 

procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);

begin

  If (Key<>chr(16)) and (Edit1.Text<>'') then

  Begin

    result:=StrToInt(Edit1.Text) Xor 468885152;

    Edit2.Text:=IntToStr(result);

  End;

end;

 

end.