1
我使用System.Xml來創建XML文檔。我需要創建一個類似於下面的內容:C#WriteAttributeString - 多個元素
<Communication primary="N" value="[email protected]" purpose="PERSONAL" type="EMAIL"/>
我可以用「WriteAttributeString」就得到就象這樣:
<Communication primary="N"/>
問題是,它不會讓我添加更多屬性我有點卡住了。任何幫助/建議將不勝感激。
編輯:代碼如下創建上述XML:
writer.WriteStartElement("CommunicationList");
writer.WriteStartElement("Communication");
writer.WriteAttributeString("primary", "N");
writer.WriteEndElement();
writer.WriteEndElement();
我需要添加「價值」,「目的」和「類型」屬性,這和我在一個損失。
感謝
我們看一些代碼。 –