C# how to make the stored file to cap at 100 items?
<p>I'm trying to make a small program that take the user input and store it on a file but I want that file to cap at 100 elements:</p>

<p>Let's say the user add 100 names and the next name the user add it will show a message "List is full"</p>

<p>Here is the code I have done so far:</p>

<pre><code>    public Form1()
    {
        InitializeComponent();
    }
    private string SongName, ArtistName;

    public void Registry()
    {
        List&lt;Name&gt; MusicList = new List&lt;Name&gt;(); //Create a List
        MusicList.Add(new Name(SongName = txtSongName.Text, ArtistName = txtArtistName.Text)); //Add new elements to the NameClass

        //check if the input is correct
        if (txtSongName.TextLength &lt; 1 || txtArtistName.TextLength &lt; 1)
        {
            Info info = new Info();
            info.Show();
        }
        else //if input is correct data will be stored
        { 
            //Create a file to store data
            StreamWriter FileSaving = new StreamWriter("MusicList", true);
            for (int i = 0; i &lt; MusicList.Count; i++)
            {
                string sName = MusicList[i].songName; //Create new variable to hold the name
                string aName = MusicList[i].artistName; //Create new variable to hold the name
                FileSaving.Write(sName + " by "); //Add SongName to the save file
                FileSaving.WriteLine(aName); //Add ArtistName to the save file

            }
            FileSaving.Close();
        }
    }

    private void btnEnter_Click(object sender, EventArgs e)
    {
        Registry();
        //Set the textbox to empty so the user can enter new data
        txtArtistName.Text = "";
        txtSongName.Text = "";
    }

    private void btnClose_Click(object sender, EventArgs e)
    {
        Application.Exit();
    }
</code></pre>
