拒绝访问路径 [英] Access to the path is denied

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

问题描述

当我们编写XML文件时,XmlWriter异常

When we write XML file then XmlWriter exception

System.UnauthorizedAccessException: Access to the path 
''D:\WorldMap\EXnetherlands_data.xml'' is denied.
 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) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) at System.Xml.XmlTextWriter..ctor(String filename, Encoding encoding)

推荐答案



问题是IIS用户或NETWORK SERVICE用户需要具有将文件写入目标文件夹位置的权限.请点击下面的链接,了解如何向该文件夹添加权限.
http://vijaymodi.wordpress.com/2007 /12/28/aspnet-access-to-the-path-cinetpubwwwroottestimagesuploadtestjpeg-is-denied/ [
Hi,

he problem is that IIS user or NETWORK SERVICE user need to have permissions to write the file to destination folder location. Follow the link below to know how to add permission to that folder.
http://vijaymodi.wordpress.com/2007/12/28/aspnet-access-to-the-path-cinetpubwwwroottestimagesuploadtestjpeg-is-denied/[^]

Hope this will help.


检查您对该文件夹的访问权限.
使用属性窗口中的安全性"选项卡为文件夹提供适当的权限
Check you access permissions to the folder.
give the proper permissions to the folder using security tab from properties window


在服务器上写入文件时,您需要对处理请求的帐户具有适当的写入权限您用来访问文件的目录.

向用户(通常为ASPNET用户)或模拟呼叫的用户帐户提供写权限.
When you are writing in a file on the server, you need to have appropriate write permission to the account processing the request on the directory that you are using to access the file.

Either provide the write permission to the user (generally ASPNET user) or to the user account that is impersonating the calls.


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

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