Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure TfrmSignUp_Page.btnSignUpClick(Sender: TObject);
- var
- UserName, Password, PasswordComf : string;
- userfile : TextFile;
- begin
- username := edtName.Text; //set the variable username as edtName.text
- password := edtPassword.Text; //set the variable password as edtPassword.text
- PasswordComf := edtComfPassword.Text; //set the variable PasswordComf as edtComfPassword.text
- if (password = passwordcomf) then //if both passwords match then
- begin //
- assignfile (userfile , 'UserNames.txt' ); //set the userfile as UserNames.txt
- append(userfile); //allow the file to be edited
- writeln (userfile, username); //write the username entered
- writeln (userfile, password); //write the password entered
- closefile (userfile); //close file
- showmessage ('You now can use your username and password'); //show the message
- lblStar.Hide; //hide the red star
- lblStar2.Hide; //hide the red star
- close;
- end
- else //else
- begin
- lblStar.Show; //show the red star
- lblStar2.Show; //show the red star
- showmessage ('Your passwords don''t match') //tell the user the passwords don't match
- end;
- end;
Add Comment
Please, Sign In to add comment