111,094
社区成员




XDocument xdoc = XDocument.Load(read);List<XElement> lst = xdoc.Document.Descendants().Where(p => p.Name.LocalName == "row" &&Convert.ToInt32(p.Attribute("r").Value) == 1).ToList();XElement xelementChild = new XElement("v");xelementChild.Value = "1";XElement xelement = new XElement("c",xelementChild); xelement.SetAttributeValue("r", "C1");xelement.SetAttributeValue("t", "s"); lst[0].Add(xelement);
<row r="1" spans="1:2" x14ac:dyDescent="0.15" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac" xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"> <c r="A1" t="s"> <v>0</v> </c> <c r="B1" t="s"> <v>1</v> </c> <c r="C1" t="s" xmlns=""> <v>1</v> </c></row>
XDocument xdoc = XDocument.Load(read);List<XElement> lst = xdoc.Document.Descendants().Where(p => p.Name.LocalName == "row" &&Convert.ToInt32(p.Attribute("r").Value) == 1).ToList();XElement xelementChild = new XElement("v");xelementChild.Value = "1";XElement xelement = new XElement("c",xelementChild); xelement.SetAttributeValue("r", "C1");xelement.SetAttributeValue("t", "s"); lst[0].Add(xelement);
<row r="1" spans="1:2" x14ac:dyDescent="0.15" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac" xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
<c r="A1" t="s">
<v>0</v>
</c>
<c r="B1" t="s">
<v>1</v>
</c>
<c r="C1" t="s" xmlns="">
<v>1</v>
</c>
</row>