File.Copy从Unc路径到(同一服务器)Unc路径查询

发布于 2024-09-04 22:02:08 字数 154 浏览 1 评论 0原文

在使用 C# 的 File.Copy 的场景中,数据流量是通过主机应用程序还是远程处理:

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

干杯,谢谢!

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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

污味仙女 2024-09-11 22:02:09

它将通过本地应用程序。文件系统不知道应用程序将如何处理从共享读取的字节,也不知道写入共享的字节来自何处。

此外,应用程序不知道(在 DFS 的情况下)这两个共享是否位于同一台计算机上。

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.

太阳公公是暖光 2024-09-11 22:02:09

如果想让服务器来处理,就必须远程运行一个复制程序。

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

忆梦 2024-09-11 22:02:08

首先,目标文件的路径中有一个小错误。

其次,没有远程复制操作。存在远程移动操作(重命名,但目标位于其他目录中),例如 MoveFile (请参阅本机 API http://msdn.microsoft.com/en-us/library/aa365239%28VS.85%29.aspx)。

更新:您可能来自 unix,并且知道实用程序 rcp,但它适用于远程 shell 服务 (rshd),而不适用于直接文件系统功能。您还可以使用 SysInternals 中的 PsExec 实用程序(请参阅 http://technet.microsoft。 com/en-us/sysinternals/bb897553.aspx)来启动远程计算机上的某些程序,但这一切都不是编程的主题。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文