Jump to content



Welcome to KnowledgeSutra - Dear Guest , Please Register here to get Your own website. - Ask a Question / Express Opinion / Reply w/o Sign-Up!
- - - - -

Delphi Password Loading To Text Box


1 reply to this topic

#1 Cena_54

    Newbie [Level 3]

  • Kontributors
  • PipPipPip
  • 48 posts

Posted 08 April 2006 - 06:15 PM

Posted Image

As you can see from this image, I have a listbox which loads in the usernames from a .DAT file, which has been encrypted and decrypted using the parsestring function.

However, I cannot get the type of user (e.g. Administrator, Supervisor, Guest) to load into the Combobox below, and the password of the user selected to load into the password Textbox. I have a procedure called:

[b]procedure[/b] LoadPasswordFile;

and in this code there is a procedure called:

[b]procedure[/b] DisplayRecord;
and the code for that is as follows:

// Display the record.
	 FrmOptions.LstUsers.ItemIndex	  := StrToInt (s_user[i_currrec]);
	 FrmOptions.CmbLoginType.ItemIndex := StrToInt (s_type[i_currrec]);
	 FrmOptions.TxtPassword.Text := s_password[i_currrec];

The code for loading the password file is below also if that helps:

/ Start to read the records into the arrays.
		  while not eof(f_handle) do
		  begin
			   Readln(f_handle, s_inputtext);

				// Check that the line contains data.
			   if s_inputtext > '' then
			   begin
					parsestring(s_inputtext, temp_string);
					s_user[i_norecords] := decrypt(temp_string, length(temp_string));
					FrmOptions.LstUsers.Items.Add(s_user[i_norecords]);
					parsestring(s_inputtext, temp_string);
					s_type[i_norecords] := decrypt(temp_string, length(temp_string));
					s_password[i_norecords] := Decrypt(Copy(s_inputtext, 2,
											   Length(s_inputtext) - 2),
											   Length(Copy(s_inputtext, 2,
											   Length(s_inputtext) - 2)));
			   end;

Thanks a lot if anyone can help me!

#2 DeveloperX

    Advanced Member

  • Kontributors
  • PipPipPipPipPipPipPip
  • 130 posts

Posted 11 April 2006 - 06:18 AM

Quote

Delphi Password Loading To Text Box

For showing password at TextBox you should use * - it's "password char" field in object inspector.




Reply to this topic


This post will need approval from a moderator before this post is shown.

  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users