Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unit Unit2;
- interface
- uses
- Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
- Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;
- type
- TFrmLogin = class(TForm)
- LblUserName: TLabel;
- LblPass: TLabel;
- EdtUser: TEdit;
- EdtPass: TEdit;
- BtnEnter: TButton;
- BtnBack: TButton;
- procedure BtnEnterClick(Sender: TObject);
- procedure BtnBackClick(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- FrmLogin: TFrmLogin;
- implementation
- {$R *.dfm}
- uses
- unit1, unit3;
- procedure TFrmLogin.BtnEnterClick(Sender: TObject);
- var
- Username, Password, User, Pass, Textstring : string;
- userfile : Textfile;
- done ,done2 : boolean;
- begin
- Assignfile (userfile, 'LoginDetails.txt');
- reset(userfile);
- username := EdtUser.text;
- Password := EdtPass.Text;
- done := false;
- while ((done = false) AND (EOF(userfile)= false)) do
- Begin
- Readln(userfile, TextString);
- User := Textstring;
- Readln(userfile, TextString);
- pass := Textstring;
- if ((Username = User) AND (Password = Pass)) then
- begin
- showmessage (' Success');
- Done := True;
- close;
- FrmGraphMenu.show;
- end;
- if (EOF(userFile)AND(done = False)) then
- begin
- Showmessage ('Try Again');
- end;
- //Readln
- End; //End of while
- CloseFile(UserFile);
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement