Guest User

Untitled

a guest
Mar 28th, 2017
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. procedure TfrmSignUp_Page.btnSignUpClick(Sender: TObject);
  2. var
  3.     UserName, Password, PasswordComf : string;
  4.     userfile : TextFile;
  5.  
  6. begin
  7. username := edtName.Text;                                                       //set the variable username as edtName.text
  8. password := edtPassword.Text;                                                   //set the variable password as edtPassword.text
  9. PasswordComf := edtComfPassword.Text;                                           //set the variable PasswordComf as edtComfPassword.text
  10.   if (password = passwordcomf) then                                             //if both passwords match then
  11.   begin                                                                         //
  12.     assignfile (userfile , 'UserNames.txt' );                                   //set the userfile as UserNames.txt
  13.     append(userfile);                                                           //allow the file to be edited
  14.     writeln (userfile, username);                                               //write the username entered
  15.     writeln (userfile, password);                                               //write the password entered
  16.     closefile (userfile);                                                       //close file
  17.     showmessage ('You now can use your username and password');                 //show the message
  18.     lblStar.Hide;                                                               //hide the red star
  19.     lblStar2.Hide;                                                              //hide the red star
  20.     close;
  21.   end
  22.   else                                                                          //else
  23.     begin
  24.       lblStar.Show;                                                             //show the red star
  25.       lblStar2.Show;                                                            //show the red star
  26.       showmessage ('Your passwords don''t match')                               //tell the user the passwords don't match
  27.     end;
  28.  
  29.  
  30. end;
Add Comment
Please, Sign In to add comment