This is my first project on C#, and I'm trying to implement a profile section to my program. I want the user to be able to put in their information, like name, address, ect, and be able to save the information the put in, and use it later on. Right now, I can only have them save one profile, and I'm lost on how to add more profiles with the click of a button. Here is my code currently to save their information:
public void button4_Click(object sender, EventArgs e)
{
profile1Name = txtProfile1Name.Text;
email = txtEmail.Text;
password = txtPassword.Text;
fullName = txtFullName.Text;
txtEmail.Text = Properties.Settings.Default.Email;
Properties.Settings.Default.ProfileName = txtProfile1Name.Text;
Properties.Settings.Default.Email = txtEmail.Text;
Properties.Settings.Default.Password = txtPassword.Text;
Properties.Settings.Default.FullName = txtFullName.Text;
Properties.Settings.Default.Save();
MessageBox.Show($"Profile saved.");
}
public void LoadSettings()
{
profile1Name = Properties.Settings.Default.ProfileName;
email = Properties.Settings.Default.Email;
password = Properties.Settings.Default.Password;
fullName = Properties.Settings.Default.FullName;
}
I have the user input their information into a text box and click save. I also have another form where users can input information, I'm just not sure how to change the names of the strings that they create.
I'm new to c#, so any other advice would be useful as well. Thank you in advance for the help :)