Advertisement
jacob_segundo

senha

Dec 20th, 2022
1,731
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 1.57 KB | None | 0 0
  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.     Label1: TLabel;
  12.     Label2: TLabel;
  13.     Label3: TLabel;
  14.     Edit1: TEdit;
  15.     Edit2: TEdit;
  16.     Edit3: TEdit;
  17.     Button1: TButton;
  18.     Button2: TButton;
  19.     procedure FormCreate(Sender: TObject);
  20.     procedure Edit1Exit(Sender: TObject);
  21.     procedure Edit3Exit(Sender: TObject);
  22.     procedure Button1Click(Sender: TObject);
  23.   private
  24.     { Private declarations }
  25.   public
  26.     { Public declarations }
  27.   end;
  28.  
  29. var
  30.   Form1: TForm1;
  31.   SenhaNova, ConfSenha: string;
  32.   VelhaSenha: string;
  33.  
  34. implementation
  35.  
  36. {$R *.dfm}
  37.   procedure TForm1.FormCreate(Sender: TObject);
  38. begin
  39. //button1.Enabled:=false;
  40.  
  41. end;
  42.  
  43.        //abilita o edit 2 e 3, se o edit1 estiver correto
  44. procedure TForm1.Edit1Exit(Sender: TObject);
  45.  
  46. begin
  47.  button1.Enabled:=false;
  48. VelhaSenha:=Edit1.text;
  49. if Edit1.Text='Delphi' then
  50. begin
  51.   Edit2.Enabled:=true;
  52.   Edit3.enabled:=true;
  53. end
  54.   else begin
  55.   Edit2.Enabled:=false;
  56.   Edit3.Enabled:=false;
  57.   end
  58.  
  59. end;
  60.  
  61.  
  62.  
  63. procedure TForm1.Edit3Exit(Sender: TObject);
  64. begin
  65.    button1.Enabled:=false;
  66. SenhaNova:=edit2.text;
  67. ConfSenha:=Edit3.Text;
  68. if SenhaNova<>confSenha then
  69. begin
  70. button1.Enabled:=false;
  71. end
  72. else
  73. Button1.Enabled:=true;
  74. end;
  75.  
  76. procedure TForm1.Button1Click(Sender: TObject);
  77. begin
  78.     SenhaNova:=edit2.text;
  79. ConfSenha:=Edit3.Text;
  80. if SenhaNova<>confSenha then
  81. begin
  82. showmessage('senha errada');
  83. end
  84. else
  85. showmessage('senha correta');
  86. end;
  87.  
  88. end.
Tags: delphi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement