Accessing a network file with FileInfo RRS feed

  • Question

  • User-407370037 posted

    My Web Applicaiton is running in Windows Authentication mode. My Web Server is running in domain LDSelfCare.

    There is a file server in domain LDCustomerCare and I want to read a file from my web application like \\machineinldcustomercaredomain\sharename\hello.txt

    I am able to open the file in Notepad but through FileInfo in C#/ASP.NET, getting an access denied. What is the issue?

    Wednesday, September 10, 2014 1:18 AM

All replies

  • User-1618234021 posted

    Are u using proper credentials while accessing file using FileInfo? Please post you code that uses FileInfo.

    Wednesday, September 10, 2014 4:31 AM
  • User-1151753377 posted

    Hi lavanyadeepak,

    According to your description, you’d like to access a network file by using FileInfo.

    Maybe you could have to impersonate user to access network share.
    You can set it in web.config looking at identity Element (ASP.NET Settings Schema)

    If there’s anything you’d like to know, don’t hesitate to ask.

    Best Regards,


    Wednesday, September 10, 2014 10:46 PM