hi, I now face some problems in saving the content of the listBox to the exist text file. i need to append the content to the text file and canot overwrite the content in the text file.Who can help me..?
FileStream fs2 = new FileStream(@"C:\Users\Fish\Desktop\fyp-coding\Combine.txt", FileMode.Append, FileAccess.Write, FileShare.ReadWrite);//create text file
StreamWriter sw2 = new StreamWriter(fs2, Encoding.Default);
foreach (string item2 in ListItemCom2.Items)
{
sw2.WriteLine(item2.ToString().Trim());// write to the text file
}
sw2.Flush();
sw2.Close();
fs2.Close()