File.Delete also deleted the wrong file
<p>I have a <code>Listbox</code> which work with specific extension files. If i choose another format, my application automatically converts the files to the correct format in the same folder (another extension) and add all the files with the wrong extension to a <code>List</code> (<code>listToRemove</code>) and remove them from my <code>Listbox</code> after i clean my <code>List</code> but first i want to delete all this files from my computer and my problem is that my appliction deleted also the file with the correct extension</p>

<pre><code>for (int i = 0; i &lt; listBoxFiles.Items.Count; i++)
{
    string path = (string)listBoxFiles.Items[i];
    FileInfo fileInfo = new FileInfo(path);

    if (fileInfo.Extension != ".avi")
    {
        listToRemove.Add(path);
    }
}

if (listToRemove.Count != 0)
{
    //method who convert the files to the new format and add the new files into my Listbox
    (new System.Threading.Thread(sendFilesToConvertToAvi)).Start(); 
}

foreach (string file in listToRemove) 
{
    File.Delete(file);
    listBoxFiles.Items.Remove(file);                  
}

public void sendFilesToConvertToAvi()
{
    if (listToRemove.Count == 0)
    {
        return;
    }

    foreach (String file in listToRemove)
    {
        FileInfo fileInfo = new FileInfo(file);

        myClassWhoConvertTheFiles = new myClassWhoConvertTheFiles (fileInfo);

        this.Invoke((MethodInvoker)delegate
        {
            listBoxFiles.Items.Add(myClassWhoConvertTheFiles ._newFileName);
        });

        count++;
    }

    listToRemove.RemoveRange(0, listToRemove.Count);
}
</code></pre>
