I'm new to C# Programming and I need to write data to csv file but with this code it writes into file but also deletes previous info in file.What should i do for write on top of existing info in csv file ?
var records = new List<user>
{
new user { Username = tBnewusername.Text, Password = Functions.ComputeSha256Hash(tbnewpassword.Text) },
};
using (var writer = new StreamWriter(Functions.bingPathToAppDir("\\data\\users.csv")))
{
using (var csv = new CsvWriter(writer, CultureInfo.InvariantCulture))
{
csv.WriteRecords(records);
}
MessageBox.Show("New User Was Created");
}