I’m using System.IO.File.Copy to copy a file to c$ on a remote server. I need to specify username/password for the connection. Is there a simple way to do this? I had hoped that System.IO.File.Copy would accept credentials as an argument but it doesn’t. How can I do this?
Share
Absolute simplest thing to do is to add this routine to your code then call it right before your File.Copy: