【发布时间】:2011-07-22 16:13:36
【问题描述】:
XMl
<?xml version="1.0" encoding="utf-8"?>
<Questions>
<Question>
<Id>1</Id>
<Text>aaaa</Text>
</Question>
<Question>
<Id>2</Id>
<Text>bbb</Text>
</Question>
</Questions>
代码
var doc = XDocument.Load(Server.MapPath(".") + "\\Questions.xml");
var elements = from element in doc.Descendants("Question")
select new
{
Id = element.Element("Id").Value,
Text = element.Element("Text").Value,
Reserver = element.Element("Reserver") != null
};
当一个项目与我同时打开Mozilla和IE8这个错误我的xml文件正在被另一个用户使用,但当然有时会给出这个错误有时没有错误
编辑
如果两个用户同时请求显示一个使用 XML 的页面。在这种情况下,我希望同时打开一个 XMl,这会导致另一个用户使用此文件时出错
【问题讨论】:
-
错误:此文件被其他用户使用
-
我可以从问题的标题中看到 this。你能解释一下你想做什么吗?你在说什么project(来自你的问题)?
标签: c# linq-to-xml