且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

缺少属性值读取XML数据

更新时间:2023-11-14 15:49:28

您可以试试这个(见空COALESCE运营商??)

You can try this (See null coalesce operator ?? )

object[] ID = XDocument.Load(path + "Data.xml").Descendants("ID").Select(element => Element.Value ?? "").ToArray();