Transfer network files C#

Asked

Viewed 1,215 times

2

I wonder if there is any way to transfer files on a local network without using the Socket Class in C#? and in terms of performance what is the fastest method of transferring files over a local network?

  • Why don’t you transfer directly to file system using File.Copy()?

  • Could you send me an example of an implementation.

  • 5

    File.Copy(@"C:\Pasta\Arquivo.txt", @"\\192.168.25.10\Pasta-Compartilhada\Arquivo.txt"); - Obviously it will only work if you have a shared folder and the user has access to the folder.

  • @jbueno Your comment probably boils down in the answer. Victor does not manipulate himself anymore.

  • It was a good response and I signaled the comment as very useful.

1 answer

3


You can use File.Copy

File.Copy(@"C:\Pasta\Arquivo.txt", @"\\192.168.25.10\Pasta-Compartilhada\Arquivo.txt");

Obviously it will only work if you have a shared folder and the user has access to the folder.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.