Spencer Long

Spencer Long

  • NA
  • 2
  • 8.2k

Writing from ArrayList to Textfile

Apr 6 2013 9:24 PM
Hi there, this is a method to write text from an Arraylist to a text file.
Any suggestions would be great.


void WriteArrayList() {
            using (StreamWriter writer = new StreamWriter("c:\\Hello.txt", true)) {
                    foreach (Object obj in ActorsArrayList)
                    {
                        writer.WriteLine(obj.ToString());
                    }
                    foreach (Object obj in ActorsArrayList) {
                    MessageBox.Show(obj.ToString());
                }

Answers (1)