📜  c# xml 检查属性是否存在 - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:17.149000             🧑  作者: Mango

代码示例1
static IEnumerable<(string key, string value)> GetNodeAttributes(XmlReader reader)
{
    for (int i = 0; i < reader.AttributeCount; i++)
    {
        reader.MoveToAttribute(i);
        yield return (reader.Name, reader.Value);
    }
}