c语言 C#中对XML文件的操作
导读:就爱阅读网友为您分享以下“C#中对XML文件的操作”的资讯,希望对您有所帮助,感谢您对92的支持!
swith(objNodeType)
{
case XmlNodeType.XmlDeclaration:
//读取XML文件头
strNodeResult+="XML
Declaration:"+objXMLReader.Name+""+objXMLReader.Value+"
"; break;
case XmlNodeType.Element:
//读取标签
strNodeResult+="Element:"+objXMLReader.Name+"
";
break;
case XmlNodeType.Text:
//读取值
strNodeResult+=" -Value:"+objXMLReader.Value+"
"; break;
}
//判断该节点是否有属性
if(objXMLReader.AttributeCount>0)
{ //用循环判断完所有节点
while(objXMLReader.MoveToNextAttibute)
{ //取标签和值
strNodeResult+="&