1

(パス 'C:\Users(user profile)\VirtualStore\Program Files (x86)\E!PC\Macros) の一部が見つかりませんでした) という例外が引き続き発生します。ディレクトリはドライブにありますが、なぜこの例外が発生し続けるのかわかりません。

Extra6DestPath = "C:\Users\(user profile)\VirtualStore\Program Files (x86)\E!PC\Macros\"

static void copyMacrosAndBitmaps(string ExtraSourcePath, string Extra6xDestPath )
    {
        //counter for total Macro count on network
        int Count = 0;
        //counter for total bitmap count on network
        int iCount = 0;

        //Get File information to use for copy 
        FileInfo[] macrosArray;
        FileInfo[] iconArray;

        //Get Directory information to use for copy 
        DirectoryInfo di = new DirectoryInfo(ExtraSourcePath);
        DirectoryInfo diIcon = new DirectoryInfo(ExtraIconPath);

        //set all macro paths as a string from directory into an array
        macrosArray = di.GetFiles("*.ebm");
        Count = macrosArray.Length;

        //set all bitmaps from directory into an array
        iconArray = diIcon.GetFiles("*.bmp");
        iCount = iconArray.Length;

        //copy macros into destination folder
        if (Count == 0)
        {
            throw new FileNotFoundException("No Macros found to copy");
        }
        else
        {
            for (int i = 0; i < Count; i++)
            {
                File.Copy(Extra6xSourcePathW7 + macrosArray[i].ToString(), Extra6xDestPath + iconArray[i].Name, true);                
            }
            //Copy the bitmaps into destination folder
            if (iCount == 0)
            {
                throw new FileNotFoundException("No bitmaps found to copy");
            }
            else
            {
                for (int i = 0; i < Count; i++)
                {
                    File.Copy(ExtraIconPath + iconArray[i].ToString(), Extra6xDestPath + iconArray[i].Name, true);
                }
            }
        }
    }
4

1 に答える 1