2011-04-14 4 views
0

네트워크 공유 폴더를 검색하여 발견 된 모든 .tif 파일에서 특정 작업을 수행하는 페이지를로드 할 때 메서드를 실행하려고합니다. 문제는 오류 받고 있어요된다ASP.NET 웹 양식에서 공유 폴더를 열거하는 중 오류가 발생했습니다.

DirectoryInfo dir = new DirectoryInfo(directory); 

FileInfo[] tifs = dir.GetFiles("*.tif", SearchOption.AllDirectories); //Throws error. 

Exception Details: System.UnauthorizedAccessException: Access to the path '\server\sharename\folder\subfolder' is denied.

ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via , the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.

To grant ASP.NET access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.

나는이 지침에 따라 시도했다, 그러나 나는 공유의 권한에 지정된 계정을 추가 할 수 아니에요. 내가 도대체 ​​뭘 잘못하고있는 겁니까?

참조 관련 질문 : Trouble accessing network share from asp.net web form

당신은 아마 액세스를 가지고 사용자를 가장 할 필요가

답변

관련 문제