Hi,
How could i copy a file from a machine to a remote server through c# code. I need help as to what methods i can use and where i need to specify the credentials of the remote server
Thanks in advance
Copy a file to remote server
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Krishna GaradRank #191 · 12.8K reputationPosted Jan 24, 2011, 11:45 PM EST
thiago costaRank #6,113 · 276 reputationPosted Jan 25, 2011, 8:39 PM EST
Vipul KelkarRank #1,061 · 1.8K reputationPosted Jan 25, 2011, 9:42 PM EST
I used windows impersonation and used the credentials of the remote machine with the LogonUser method . Then i used the simple file.copy with the destination path as the path of the remote drive.
File.Copy(@"local path",@\\remote_machine_name\d$); to copy the file to D:\ drive of the remote machine