I coded a button to add input as a string to a text file , but i want to add a string to the file each time the button is being press, as it is rigth now my program overwrites the old string in the file.
Code for button :
private void BtnRegister_Click(object sender, EventArgs e)
{
username = txtUsername.Text;
password = txtPassword.Text;
using (StreamWriter writer = new StreamWriter(path))
{
writer.WriteLine(username + ' ' + password);
}
}