My problem is to copy file from one system to another system on the same network. I googled for the above problem, I started working with Mark Brackett's answer.
Now i am planning to copy the files from my system to another system, but i am getting following error codes 53, 67, 2202. I resolved the first two error codes successfully. Now i am stuck with 2202. please look into the below code.
NetworkCredential credentials = new NetworkCredential(@"\\192.168.0.110\", "krishna4");
private void btnClick_Click(object sender, EventArgs e)
{
// NetwrokConnection(string networkName, NetworkCredential credentials)
using (new NetworkConnection("\\\\10.235.115.210\\d", credentials)) ;
System.IO.File.Copy("D:\\English\\parts.oxps", @"\\192.168.0.110\test\parts.oxps", true);
}
Please help to resolve the problem. Thanks in advance.
I think your connection credentials may be wrong.it may be invalid user name.
I suggest to refer following link:
ERROR_BAD_USERNAME
WNetUseConnection2 in C#
How to finish this implementation of creating a network share using WNetAddConnection2?
Here is Sample Code;