How to access folders on external network with C # asp.net?

2

When I try to read files on another network (which requires authentication), the error below occurs. The same problem I also have when I try to access protected folders.

Does anyone know how I can solve this?

DirectoryInfo dirE = new DirectoryInfo(@"\\123.45.6.78\dados\Chapolin");
FileInfo[] filesE = dirE.GetFiles("*", SearchOption.AllDirectories);
  

Additional information: Login failed: unknown user name   or incorrect password.

    
asked by anonymous 26.10.2016 / 15:21

1 answer

3

Well, I've seen a solution here:

link

Basically, change the file path to this pattern:

\IPdoServidor\Pasta\documento.txt@usuárioComPermissão,SenhaDoUsuário

See if it solves your problem

    
03.11.2016 / 16:51