Hi,
maybe you try this way to copy your remote testfile to local server.
string[] fileEntries = Directory.GetFiles(@"YOUR_SERVER_DIRECTORY");
foreach (string fileName in fileEntries)
ProcessFile(fileName);
public static void ProcessFile(string filename)
{
FileInfo finfo = new FileInfo(filename);
if (finfo.Name == "test")
{
File.Copy(finfo_fir.FullName,@"C:\DESTINATION_PATH");
}
}
If you try to increase the performance of copying a file, the delivered File.Copy()-Method is pretty robust.
In some cases it's certainly possible to increase the Performance by taking care of a few things like using Asynchcronus FileStreams in Multithreading and taking care of your buffersize and adjusting it to the RAM.
Here's a very good discussion about it:
http://stackoverflow.com/questions/1286354/how-to-make-my-application-copy-file-faster[
^]
http://stackoverflow.com/questions/1246899/file-copy-vs-manual-filestream-write-for-copying-file[
^]
Regards