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?
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.
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.
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.
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With