Hello 
Ok so this is the problem, I am writing a basic program in Delphi 7 and need some help. Basically the program is a unit converter (Like currencies and speed etc.)
There are a few things I need help with:
1) For my program I need to have a login form. Currently usernames and passwords are being stored in 2 listboxes, one for the names and the other for the passwords. I would like to rather save these usernames and passwords in a textfile.
I have already written the code on form activation to to assign 2 text files. Now how I want this to work is that on program startup all the entries in the users.txt must be carried over to listbox 1 and all the entries in the passwords.txt must be carrried over to the listbox 2. And when a new user is registered the username must be transfered to the users.txt and the password to the password.txt file.
How can I achieve this?
BTW my current Login procedure looks like this:
Ok so this is the problem, I am writing a basic program in Delphi 7 and need some help. Basically the program is a unit converter (Like currencies and speed etc.)
There are a few things I need help with:
1) For my program I need to have a login form. Currently usernames and passwords are being stored in 2 listboxes, one for the names and the other for the passwords. I would like to rather save these usernames and passwords in a textfile.
I have already written the code on form activation to to assign 2 text files. Now how I want this to work is that on program startup all the entries in the users.txt must be carried over to listbox 1 and all the entries in the passwords.txt must be carrried over to the listbox 2. And when a new user is registered the username must be transfered to the users.txt and the password to the password.txt file.
How can I achieve this?
BTW my current Login procedure looks like this:
Code:
procedure TMainForm.LoginbtnClick(Sender: TObject);
var
amount : integer;
S : integer;
begin
amount := 0;
S := -1;
loggedin := false;
Repeat
begin;
amount := amount + 1;
S := S + 1;
IF (LoginName.Text = LoginNameList.Items[S]) and (Loginpass.Text = LoginPassList.items[S]) THEN
begin
Showmessage('Thank you for logging in');
MainPage.Visible := true;
LoginPanel.Visible := False;
LoggedIn := true;
Logoffbtn.Visible := true;
exit;
end
end;
Until amount = 5;
IF loggedin = false THEN
begin
Showmessage('Invalid login details entered, please try again');
exit;
end;