Author: mm8 | Posted on: 8/14/2009 6:14:24 AM | Views : 356

 How do I "log in" as a certain user when I want to copy files to a remote server with System.File.IO.Copy? I am getting a IOException saying "bad username or password" when trying to copy a file from my local computer to a remote server. I can access the server with \\vpnaddress\c$ in Windows. I am then being prompted for the username and password. How do I pass the username and password when using System.IO.File.Copy. Can it be done with impersonation?
How is it done in a Windows Forms application where I guess the program is run under the current windows user? I guess there has to be a way of passing the credentials to the remote server to gain access, right?
...

Go to the complete details ...