我在我的c#项目中添加了一个XML文件作为资源文件(参考资料 - >添加资源(向下箭头)添加现有文件。)
我正在从文件中读取没有问题:
static XElement resource;
static List<PageType> allPageType;
static public List<PageType> getAllPageLayout()
{
try
{
resource = XElement.Parse(Properties.Resources.PageTypeConfig);
}
catch { }
var query = from p in resource.Elements()
select new PageType()
{
name = p.Element("name").Value,
culomnNumber = Int32.Parse(p.Element("CulNember").Value),
rowNumber = Int32.Parse(p.Element("rowNumber").Value),
culomnWidth = Double.Parse(p.Element("culWidth").Value),
rowHeight = Double.Parse(p.Element("rowHeight").Value)
};
return query.ToList();
}
但我找不到添加或修改资源文件元素的方法。
答案 0 :(得分:1)
无法更改嵌入资源。