这是我的代码:
XmlNodeList ProjectNode = DOC.GetElementsByTagName("AppBuilderProject");
foreach (XmlNode AllNodes in ProjectNode)
{
Project.Titel = AllNodes["Titel"].InnerText; // 1st value from node
foreach (XmlNode controlsform in Project.Forms) // arraylist Forms
{
Project.Forms = controlsform["forms"].InnerText;// error
}
}
请告诉我如何解决此问题。
答案 0 :(得分:1)
属性“Project.Forms”显然是类型arraylist和属性(XmlNode).InnerText是字符串
试试这个
if(Project.Forms == null) Project.Forms = new ArrayList();
Project.Forms.Add(controlsform["forms"].InnerText);