[英]Why does XmlDocument.Load(String) seem to want read-write access?
According to MSDN the .NET XmlDocument.Load(String) method requires write access to the underlying file.根据 MSDN,.NET XmlDocument.Load(String)方法需要对底层文件进行写访问。 The exceptions list says
例外清单说
UnauthorizedAccessException : filename specified a file that is read-only....
My question boils down to我的问题归结为
Is it even true that read-write access is needed
是否真的需要读写访问权限
XmlDocument
creates XmlReader
, which, AFAIK, doesn't throws such exceptions.XmlDocument
会创建XmlReader
,AFAIK 不会引发此类异常。Does it mean that the file is kept open during the lifetime of the object
这是否意味着文件在对象的生命周期内保持打开状态
Does it mean that modifications to the the XmlDocument and its sub-nodes can result in live modifications to the file on disk
这是否意味着对 XmlDocument 及其子节点的修改会导致对磁盘上的文件进行实时修改?
with async
attribute set to False
as in XDoc.async = False
, the read-only xml does not get loaded into DOM object在
XDoc.async = False
async
属性设置为False
,只读 xml 不会加载到 DOM 对象中
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.