前端之家收集整理的这篇文章主要介绍了
读取XML ,IOS、Android、PC,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
XmlDocument xmlDoc = new XmlDocument();
TextAsset textAsset = (TextAsset) Resources.Load("tips",typeof (TextAsset));
xmlDoc.LoadXml(textAsset.text);
XmlNodeList node = xmlDoc.SelectSingleNode("plist").ChildNodes;
foreach (XmlElement nodeList in node)
{
foreach (XmlElement xe in nodeList)
{
if (xe.Name == "array")
{
int i = 0;
_tips = new string[xe.ChildNodes.Count];
foreach (XmlElement xe1 in xe.ChildNodes)
{
_tips[i] = xe1.InnerText;
i++;
}
break;
}
}
// }
}
@H_
301_2@用此种
方法!
XmlDocument xmlDoc = new XmlDocument();
TextAsset textAsset = (TextAsset) Resources.Load("tips",typeof (TextAsset));
xmlDoc.LoadXml(textAsset.text);
原文链接:https://www.f2er.com/xml/298663.html