I need to save the username and password that the user entered into the text file, but it creates the text file and saves the texts before the user enters them. (This creates an empty text file).
I think I need to do something with the procedure, but although I was looking for a solution, I could not find.
My code is:
[Code]
var
Page: TInputQueryWizardPage;
username: String;
password: String;
procedure InitializeWizard;
begin
{ Create the page }
Page := CreateInputQueryPage(wpWelcome,
'Username & Password', 'Username like : e201600',
'Please enter your username and password.');
{ Add items (False means it not a password edit) }
Page.Add('Username:', False);
Page.Add('Password:', True);
{ Set initial values (optional) }
Page.Values[0] := ExpandConstant('hello5');
Page.Values[1] := ExpandConstant('');
{ Read values into variables }
username := Page.Values[0];
password := Page.Values[1];
SaveStringToFile('c:\filename.txt', username+#13#10+password+#13#10, False);
end;
source
share