1
Answer

Writing from ArrayList to Textfile

Spencer Long

Spencer Long

11y
3.5k
1
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)