c# public static bool IsSelectNode(string xmlPath,string nod

学习 时间:2026-05-30 16:26:33 阅读:3620
c# public static bool IsSelectNode(string xmlPath,string node){XmlDocument xmlDoc = new XmlDocument();xmlDoc.Load(xmlPath);XmlNode result = xmlDoc.SelectSingleNode(@"//" + node);return result = null;//就这行}

最佳回答

秀丽的花生

认真的蚂蚁

2026-05-30 16:26:33

eturn result != null;这行是反会是否获取到你的XML文档的判断!如果没获取到文档那么result肯定为NULL,则result != null返回的就是false如果获取到了那么result != null返回的就是true

最新回答共有2条回答

  • 灵巧的服饰
    回复
    2026-05-30 16:26:33

    eturn result != null;这行是反会是否获取到你的XML文档的判断!如果没获取到文档那么result肯定为NULL,则result != null返回的就是false如果获取到了那么result != null返回的就是true

上一篇 kids是kid的复数吗

下一篇 在和里孟子各阐述了怎样的主张