访问路径被拒绝 [英] Access to the path is denied
问题描述
我知道这个问题被问了很多次这里,但我不能找到一个解决我的问题。 我试图挽救形象在.NET C#中的文件夹,但这种例外:
I know this question was asked many times here, but I can't find a solution to my problem. I'm trying to save image to the folder in .net c# but get this exception:
Access to the path 'C:\inetpub\wwwroot\mysite\images\savehere' is denied.The error occured at mscorlib because at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode)
我给予了充分的控制,该文件夹(savehere),以网络服务
和 IIS_IUSRS
,甚至给予了充分的控制权每个人
,但仍然得到此异常。
我试着给通过浏览器,并通过IIS管理器中,仍然没有运气
I gave full control to this folder (savehere) to network service
and iis_iusrs
, even gave full control to everyone
but still getting this exception.
I tried to give access via explorer and via IIS manager, still no luck
我在做这在Windows Server 2008 R2上和IIS 7.5,谁让我需要给访问?
I'm doing it on Windows server 2008 R2 and IIS 7.5, Who do I need to give access?
感谢
推荐答案
您需要从应用程序池的网站究竟是什么在其下运行的身份(默认情况下为应用程序池发现身份
),并给予正确的权限。
You need to find out from the application pool for the website what is the identity it is running under (by default this is Application Pool Identity
) and grant that the correct permissions.
这篇关于访问路径被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!