我有这一法典:
XDocument xdoc = XDocument.Parse(xml);
XElement xe = xdoc.Root.Element("program");
string[] data = new string[3];
XElement element = xe.Element("name");
data[0] = element.Value;
element = xe.Element("version");
data[1] = element.Value;
element = xe.Element("beta");
data[2] = element.Value;
return data;
或许可以这样作:
xe.Element["name"].Value
xe.Element["version"].Value
I know I can t write exactly like that, but is their any method that works like that one? So that I get rid of some lines and makes the process faster.