Hi,
I would like to implement a console app which should copy a specific folder from server A to server B. Is there a way to do this?
Best Regards.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
yashu yashPosted Oct 29, 2015, 1:21 AM
Parveen SiwachPosted May 28, 2013, 4:56 AM
If you can copy the file in Explorer, the File.Copy method will work.
And for other network, the following code will work:
using (new NetworkConnection(@"\\server\read", readCredentials))
using (new NetworkConnection(@"\\server2\write", writeCredentials)) {
File.Copy(@"\\server\read\file", @"\\server2\write\file");
}