I have wrote a C# console application to copy lots of small XML files (about 80000 files, round about 300KB each, total size of about 3GB gets transferred) from a share directory on an AS400 Machine to a share directory on a windows Machine.

The two machine are on the same LAN, but it is taking many hours to do the copying. I need to loop through the files, as I need to update a table in the DB, I know this could maybe the bottle neck, but excluding the SQL update; Is there a faster way to transfer these files?

```
    public void CopyFiles()
    {
        DirectoryInfo IFS = new DirectoryInfo(@"\\AS400Machine\ShareFolder\");

        string NewPath = @"\\WindowsMachine\ShareFolder\";

        Directory.CreateDirectory(NewPath);
        foreach (FileInfo xmlFile in IFS.GetFiles())
        {
            var newFullPath = string.Format(@"{0}\{1}", NewPath, xmlFile.Name);

            // SQL Update

            // Copy File
            xmlFile.CopyTo(newFullPath, true);
        }
    }

```