Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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). Application (same C# windows application) on the local system will use it for help.

What needs to be done to accomplish this?

I understand File.Copy() but i don't know, will it hold for remote system also?

like image 357
Dhanapal Avatar asked Jun 03 '09 13:06

Dhanapal


People also ask

How copy file from local system to remote system?

To copy files from a local system to a remote server or remote server to a local system, we can use the command 'scp' . 'scp' stands for 'secure copy' and it is a command used for copying files through the terminal. We can use 'scp' in Linux, Windows, and Mac.

How do I copy a file to a remote server?

You can use SecureShell (SSH) or Remote Sync (Rsync) to transfer files to a remote server. Secure Copy (SCP) uses SSH to copy only the files or directories that you select. On first use, Rsync copies all files and directories and then it copies only the files and directories that you have changed.

How do I copy a file to a remote server in Linux?

In Unix, you can use SCP (the scp command) to securely copy files and directories between remote hosts without starting an FTP session or logging into the remote systems explicitly. The scp command uses SSH to transfer data, so it requires a password or passphrase for authentication.


1 Answers

File.Copy(
    @"C:\localpath\file.hlp", 
    @"\\remotemachinename\localpathonremotemachine\file.hlp");

Or something along those lines... the second value is a UNC path.

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).

like image 80
jerryjvl Avatar answered Oct 13 '22 01:10

jerryjvl