在C#为什么我写入这样的元素,总不能关闭呢?
XmlWriter writer = XmlWriter.Create("booknew.xml", settings);
writer.WriteStartElement("DBaseLink");
writer.WriteAttributeString("Confidentiality", "Outsourcer");
writer.WriteAttributeString("Type", "Bug");
writer.WriteAttributeString("Database", "AXSE");
writer.WriteAttributeString("Value", "1123456");
writer.WriteEndElement(); // close DBaseLink
write.Flush();
write.Close();
结果是
<?xml version="1.0" encoding="utf-8"?><DBaseLink Confidentiality="Outsourcer" Type="Bug" Database="AXSE" Value="1123456" />
这个元素关闭不了
一只斗牛犬
墨色风雨