Help with GetDirecotry/CopyDirectory

BpenaBpena United States
I am simply trying to copy a directory from a robot controller on the network to the local hard drive but i keep receiving this error:

'Operation is not valid due to the current state of the object.'

Here is my code:

        private void SycnButton_Click(object sender, EventArgs e)
            string controllerid;
            string localpath;
            string remoteDir = aController.FileSystem.RemoteDirectory;

            localpath = @C:\Users\ + Environment.UserName + @\Documents\RobotStudio\Temp\;
            controllerid = aController.SystemName;

            aController.FileSystem.GetDirectory(remoteDir, localpath);

Can someone please point me in the right direction, thank you in advanced!


Sign In or Register to comment.