Access Share folder in c#
-
My Web App want to access a share folder //IP/share/detail. The folder "detail" was shared to everyone. in Web.Config identity impersonate="true" was added. in machine.config processModel userName="SYSTEM" password="AutoGenerate" userName was changed. In code
File.Exists("//IP/share/detail/"+fileName)
It return false although the file exist in the folder. Do you have any idea why the file cannot be access? -
My Web App want to access a share folder //IP/share/detail. The folder "detail" was shared to everyone. in Web.Config identity impersonate="true" was added. in machine.config processModel userName="SYSTEM" password="AutoGenerate" userName was changed. In code
File.Exists("//IP/share/detail/"+fileName)
It return false although the file exist in the folder. Do you have any idea why the file cannot be access?Are you sure the process is using impersonation and not the built in ASP.NET account? Change your IIS settings to force Windows Authentication and try again, if it works then you know it is an impersonation failure of some sorts.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway