CSharp examples for System.Xml:XML Attribute
Get U Short Attr
using System.Xml.Linq; using System;/*from w ww .j a v a 2 s . c om*/ public class Main{ public static ushort GetUShortAttr(this XElement elem, string name) { ushort.TryParse(elem.GetAttrValue(name), out var v); return v; } public static string GetAttrValue(this XElement elem, string attrName) { return elem.Attribute(attrName)?.Value; } }