I am trying to list files on a UNC folder
[HttpGet]
public IEnumerable<string> Get()
{
var list = Directory.GetFiles(@"\\files.mydomain.com\folder");
return list;
}
But it is giving this Exception
System.UnauthorizedAccessException: 'Access to the path '\\files.mydomain.com\folder' is denied.'
How can I inform the username and password using C# code on ASP.Net Core 2?