Please help me with making my array size to get increased, each time there is an input from a user : I am writing data from user's input into a text file in c#, using array.

I have tried using array and ArrayList, yet it didn't work.

    FileStream fs = new FileStream("FirstName.txt", FileMode.Append, FileAccess.Write);
    StreamWriter w = new StreamWriter(fs);
    Console.WriteLine("Enter a string");
    string str = Console.ReadLine();
    string[] thearray = new string[1];
    thearray[0] = str;
    w.WriteLine(thearray[0]);
    w.Flush();
fs.Close();

It should insert the user's values to the array, and from the array to the text file.