[英]How to copy file from local system to other system in C# (windows app)?
I need to load help files from my windows C# application and move/copy to other system (to its local drive). 我需要从我的Windows C#应用程序加载帮助文件并移动/复制到其他系统(到其本地驱动器)。 Application (same C# windows application) on the local system will use it for help. 本地系统上的应用程序(相同的C#windows应用程序)将使用它来提供帮助。
What needs to be done to accomplish this? 要做到这一点需要做些什么?
I understand File.Copy()
but i don't know, will it hold for remote system also? 我理解File.Copy()
但我不知道,它是否也适用于远程系统?
File.Copy(
@"C:\localpath\file.hlp",
@"\\remotemachinename\localpathonremotemachine\file.hlp");
Or something along those lines... the second value is a UNC path. 或者沿着这些线的东西......第二个值是UNC路径。
And in case the target location needs a login and password, the following answer is applicable: Copy file to remote computer using remote admin credentials (Thanks to Carlos Rendon for finding it). 如果目标位置需要登录名和密码,则以下答案适用: 使用远程管理凭据将文件复制到远程计算机 (感谢Carlos Rendon找到它)。
File.Copy() Copies an existing file to a new file. File.Copy()将现有文件复制到新文件。 The target can be a remote share (UNC). 目标可以是远程共享(UNC)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.