1

I'm trying to create a folder on remote machine (computer is in same network). I'm using the code, when I try to excue the code, I'm getting following error message:

Logon failure: unknown user name or bad password.

Can any one suggest me how to create a folder on remote machine (which is in same network)?

enter image description here

string path = @"\\16.166.187.121\c$\testingfolder\Features\Temp\";
if (!Directory.Exists(path))
{
    DirectoryInfo di = Directory.CreateDirectory(path);
}
Andre Hofmeister
  • 3,185
  • 11
  • 51
  • 74
N.RaviKumar
  • 275
  • 1
  • 5
  • 14

1 Answers1

0

i guess something is wrong with your credential. take a look at here: How to provide user name and password when connecting to a network share

Community
  • 1
  • 1
Mohammad
  • 2,724
  • 6
  • 29
  • 55