Am not sure how to handle the default in switch?
<pre><code>class Program
{
    static void Main(string[] args)
    {
        var getfiles = new fileshare.Program();

        string realname = "*test*";
        string Location = "SVR01";
        foreach (var file in getfiles.GetFileList(realname,Location))
        {getfiles.copytolocal(file.FullName); }

        }
    private FileInfo[] GetFileList(string pattern,string Location)
    {

        try
        {
            switch (Location)
            {
                case "SVR01":
                    {
                        var di = new DirectoryInfo(@"\\SVR01\Dev");
                        return di.GetFiles(pattern);
                    }
                case "SVR02":
                    {
                        var di = new DirectoryInfo(@"\\SVR02\Dev");
                        return di.GetFiles(pattern);
                    }
                case "SVR03":
                    {
                        var di = new DirectoryInfo(@"\\SVR03\Prod");
                        return di.GetFiles(pattern);
                    }
                default: throw new ArgumentOutOfRangeException();

            }
        }
        catch(Exception ex)
        { Console.Write(ex.ToString());
        return null;
        }

    }
    private void copytolocal(string filename)
    {
        string nameonly = Path.GetFileName(filename);
        File.Copy(filename,Path.Combine(@"c:\",nameonly),true);

    }
    }
</code></pre>

<p>Am handle the default switch statement but not sure am doing right,some one please correct me .</p>

<p>Thanks in Advance</p>
