System.UnauthorizedAccessException:对路径被拒绝 [英] System.UnauthorizedAccessException: Access to the path is denied

查看:1322
本文介绍了System.UnauthorizedAccessException:对路径被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

不管我做什么,如给网络服务和ASP.NET帐户完全权限到包含图像,我仍然得到这个错误的System.IO.File.Move的文件夹。任何人都知道我可以在这里失去了什么其他的帐户?网络服务是在其下运行这个网站上,我给网络服务完全权限到整个文件夹中运行的应用程序池的帐户。

No matter what I do such as give Network Service and the ASP.NET account full rights to the folder that contains the image, I am still getting this error for a System.IO.File.Move. Anyone know what other accounts I may be missing here? Network Service is the account running the app pool under which this site runs on and I gave Network Service full rights to the entire folder.

我用尽了一切。我给了网络服务和计算机名\\ ASPNET完全权限包含此.JPG文件夹。我测试这个code和本地主机上的这一举动......我的开发人员的机器。

I've tried everything. I gave Network Service and the machinename\aspnet full permissions to the folder that contains this .jpg. I'm testing this code and this move on localhost...my developer machine.

推荐答案

在托管共享驱动器的计算机,请务必设置的东西,在这两个标签:

On the machine hosting the shared drive, make sure to set things up under both these tabs:


  • 共享 - >权限

  • 安全

  • Sharing -> Permissions
  • Security

我们中的大多数应对安全选项卡获取IIS的东西的工作,但它是在给我的.MoveTo()方法相同的问题,前者。 (它可以读取,只是不动)。

Most of us deal with the Security tab for getting IIS stuff working, but it was the former that was giving me the same issue with the .MoveTo() method. (It could read, just not move).

要更复杂的问题,我也有作为多个名字共享的目录 - 确保检查的权限为每个共享名称

To further complicate matters, I also had the directory shared as multiple names - make sure to check the permissions for each shared name.

这篇关于System.UnauthorizedAccessException:对路径被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆