Return to Snippet

Revision: 20633
at November 20, 2009 09:43 by iLLUMIN


Initial Code
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Edit1: TEdit;
    procedure Edit1KeyPress(Sender: TObject; var Key: Char);
    procedure Edit1KeyUp(Sender: TObject; var Key: Word;
      Shift: TShiftState);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  q : string; //str of *
  w : string; //real str
  e : longint;

implementation

{$R *.dfm}

procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
if Key = #27 then begin
  AssignFile(output, 'output.txt'); rewrite(output);
    writeln(output,w);
  CloseFile(output);
end;
if Key = #8 then begin
  if length(w) > 0 then begin
  SetLength(q,(length(q)-1));
  SetLength(w,(Length(w)-1));
  Edit1.Text := q;
  end;
end
else begin
 q := q + '*';
 Edit1.Text := q;
 e := Length(w) + 1;
 SetLength(w,e);
 w[e] := Char(Key);
end;
end;

procedure TForm1.Edit1KeyUp(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
Edit1.Text := q;
end;

end.

Initial URL
www.sa1t.ru

Initial Description
This program make input type for password.

Initial Title
For enter passwords

Initial Tags


Initial Language
Delphi