Hello i am trying to access a network folder from my ASP.NET Intranet web application. This is my code
Dim di As DirectoryInfo = New DirectoryInfo("\\10.11.11.172\testfolder")
Dim subFiles() As FileInfo = di.GetFiles()
and i get
Access to the path '\\10.11.11.172\testfolder\' is denied.
How can i enter my username and password in order to make it work?
Your web application is running using NETWORK SERVICE account.
You have to impersonate user to access network share.
You can set it in web.config looking at identity Element (ASP.NET Settings Schema)