摘要:
1 using (var sw = new StringWriter()) 2 { 3 var xtw = new XmlTextWriter(sw); 4 //根节点 5 xtw.WriteStartElement("Test"); 6 //内容 7 xtw.WriteAttributeString("Name", "内容"); 8 xtw.WriteEndElement(); 9 string strInString = sw.ToString();10 } 1 string strInString = ""; 阅读全文