How to copy a file from the local system to another system in C # (Windows application)?

I need to download help files from my Windows C # application and move / copy to another system (to my local drive). An application (the same Windows C # application) on the local system will use it for reference.

What needs to be done for this?

I understand File.Copy() , but I don’t know if it will be used for the remote system too?

+6
c # file-copying
source share
2 answers
 File.Copy( @"C:\localpath\file.hlp", @"\\remotemachinename\localpathonremotemachine\file.hlp"); 

Or something on these lines ... the second value is the UNC path.

And if the target location needs a username and password, the following answer applies: Copy the file to a remote computer using the remote administrator credentials (Thanks to Carlos Randon for finding it).

+8
source share

File.Copy () Copies an existing file to a new file. The target may be a remote share (UNC).

+3
source share

All Articles