'访问路径'x'被拒绝了创建文件时的消息
我有一个简单的 Web 项目,只有一行:
File.Create(Server.MapPath(".") + "\asaf.txt").Close();
它会在项目文件夹中创建一个空白文本文件,就是这样。
它在 VS2010 中工作正常,但在我在 IIS 中创建一个指向此项目文件夹的虚拟目录并从 IIS 中“浏览”default.aspx 文件后。我得到:
“访问路径 'C:\Documents and Settings\Asaf\My Documents\Visual Studio 2010\Projects\TestApp\TestApp\asaf.txt' 被拒绝。”
- ASP.NET版本没问题。
- 匿名访问复选框被选中(已经像这样了),
- “集成 Windows 身份验证”也被选中。
- 我在虚拟目录属性中授予了所有权限:读取、写入、脚本源访问、目录浏览...这没有帮助。
在我的工作场所,我转到文件夹属性并给予完全控制,它解决了问题,但是当我进入家用计算机上的文件夹属性时,我在任何地方都找不到它,“完全控制”屏幕在哪里?我该如何解决这个问题?
i have a simple web project that has one row :
File.Create(Server.MapPath(".") + "\asaf.txt").Close();
it creates a blank text file in the project folder, thats it.
it works fine in the VS2010 , but after i created a virtual directory in the IIS that points to this project folder and 'Browse' the default.aspx file from teh IIS. i get :
"Access to the path 'C:\Documents and Settings\Asaf\My Documents\Visual Studio 2010\Projects\TestApp\TestApp\asaf.txt' is denied."
- the ASP.NET version is ok.
- the Anonymous Access check box is checked (it was like that already)
- the "integrated windows authentication" is checked too.
- i gave all permissions in the vitual directory properties: read ,write, script source access, directory browsing... it doesn't help.
at my workplace i went to the folder properties and gave full control and it solved the problem but when i get inside the properties of folder on my home computer I CAN'T FIND IT ANYWHERE , where is the "full control" screen? and how do i solve the problem ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,解决了,
如果“安全”选项卡未显示在您的文件夹属性上,
ok , solved it ,
if the "Security" tab doesn't show on your folder properties,