Hi Folks
Thanks to djones7936 on this forum I've got a nice sub routine that copies all of the files and subdirectories within a directory to another directory. The thing is, I'm having a bit of trouble implementing the subroutine. I'm a bit new to C# so I've been reading like mad but I still can't see where I'm going wrong:
using System;
public class FileCopier
{
public static void Main()
{
CopyAllFiles("C:\\test\\test1A", "C:\\test\\test2A", true);
}
private void CopyAllFiles(string strSourceDirectory, string strDestinationDirectory, bool bCheckSubdir)
{
// Code contained here thanks to djone7936
}
}
When I try to call the subroutine like this I get the following error:
An object reference is required for the nonstatic field, method, or property 'FileCopier.CopyAllFiles(string, string, bool)'
What glaring error have I made here?!
Cheers,
Kenny.
Thanks to djones7936 on this forum I've got a nice sub routine that copies all of the files and subdirectories within a directory to another directory. The thing is, I'm having a bit of trouble implementing the subroutine. I'm a bit new to C# so I've been reading like mad but I still can't see where I'm going wrong:
using System;
public class FileCopier
{
public static void Main()
{
CopyAllFiles("C:\\test\\test1A", "C:\\test\\test2A", true);
}
private void CopyAllFiles(string strSourceDirectory, string strDestinationDirectory, bool bCheckSubdir)
{
// Code contained here thanks to djone7936
}
}
When I try to call the subroutine like this I get the following error:
An object reference is required for the nonstatic field, method, or property 'FileCopier.CopyAllFiles(string, string, bool)'
What glaring error have I made here?!
Cheers,
Kenny.