Jump to content
xisto Community
Sign in to follow this  
Cena_54

Delphi Password Loading To Text Box

Recommended Posts

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!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.