문제

Will data traffic go through the host application program or will be dealt remotely in scenarios where C#'s File.Copy is used:

File.Copy(@"\\SERVER13\LOL\ROFL.txt", @"\\SERVER13\ROFL.txt")

Cheers n thx!

도움이 되었습니까?

해결책

First of all you have a small bug in the path of the destination file.

Second, there are no remote copy operation. There exist a remote move operation (rename, but with a destination in other directory) like MoveFile (see native API http://msdn.microsoft.com/en-us/library/aa365239%28VS.85%29.aspx).

UPDATED: Probably you came from unix and knows utility rcp, but it works with respect of remote shell service (rshd) and not with respect of direct file system features. You can also use PsExec utility from SysInternals (see http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx) to start some program on the remote computer, but all this is not a subject of programming.

다른 팁

It will go through the local application. The file system does not know what the application is going to do with the bytes it reads from the share, or where the bytes that are written to the share come from.

In addition, the application does not know (in the case of DFS) if the two shares are on the same machine.

If you want to let the server handle it, you have to remotely run a copy program.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top