Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unit caduser;
- interface
- uses
- Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
- Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.Buttons, PngBitBtn;
- type
- TForm2 = class(TForm)
- Edit1: TEdit;
- Edit2: TEdit;
- Label1: TLabel;
- Label2: TLabel;
- Label3: TLabel;
- Button2: TButton;
- PngBitBtn1: TPngBitBtn;
- procedure FormCreate(Sender: TObject);
- procedure Button2Click(Sender: TObject);
- procedure PngBitBtn1Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- Form2: TForm2;
- implementation
- {$R *.dfm}
- uses U_dados, ucriptografia;
- procedure TForm2.Button2Click(Sender: TObject);
- begin
- CLOSE;
- end;
- procedure TForm2.FormCreate(Sender: TObject);
- begin
- dm.Qlogin.close;
- dm.Qlogin.SQL.Clear;
- dm.Qlogin.SQL.Add('Select * from login');
- end;
- procedure TForm2.PngBitBtn1Click(Sender: TObject);
- begin
- if Trim(edit1.Text) = '' then
- begin
- Application.MessageBox('Preencha o campo senha.','Atenção',MB_OK+MB_ICONWARNING);
- edit1.SetFocus;
- Abort;
- end;
- if Trim(edit2.Text) = '' then
- begin
- Application.MessageBox('Preencha o campo usuario.','Atenção',MB_OK+MB_ICONWARNING);
- edit2.SetFocus;
- Abort;
- end;
- dm.Qlogin.Open;
- dm.Qlogin.Insert;
- dm.Qloginusuario.Value:=edit1.Text;
- dm.Qloginsenha.Value:=cript('C', edit2.Text);
- dm.Qlogin.Edit;
- dm.Qlogin.Post;
- ShowMessage('SUA SENHA E SEU USUARIO FORMA SALVOS COM SUCESSO');
- edit1.Text:='';
- edit2.Text:='';
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement