InvalidCastException trying to cast Object[] array to string array
<p>I have a method that takes an ArrayList object as a parameter.</p>

<p>I then try to convert this arrayList into a string array but get an InvalidCastException.</p>

<p>The ArrayList contains a seven random numbers. As they are of the type object I am assuming it shouldnt be a problem casting it into a string.</p>

<p>This is the method that I have called</p>

<pre><code>p.matches(winningNumber);

public void matches(ArrayList al)
    {
        try
        {
            string nameFile;

            string[] winningNumber = (string[])al.ToArray(typeof(string));

            Console.WriteLine("Please enter the name of the file you want to Read from");
            nameFile = Console.ReadLine();
</code></pre>

<p>it is with the attemt at casting that I get an exception.</p>
