1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | // Writting XmlDocument xmlDoc = new XmlDocument(); XmlNode nodeItems = xmlDoc.CreateNode( "element" , "Items" , "" ); foreach (ListViewItem item in ListView.Items) { XmlNode nodeItem = xmlDoc.CreateNode( "element" , "Item" , "" ); XmlNode nodeFind = xmlDoc.CreateNode( "element" , "Find" , "" ); nodeFind.InnerText = "..." ; XmlNode nodeReplace = xmlDoc.CreateNode( "element" , "Replace" , "" ); nodeReplace.InnerText = "..." ; nodeItem.AppendChild(nodeFind); nodeItem.AppendChild(nodeReplace); nodeItems.AppendChild(nodeItem); } xmlDoc.AppendChild(nodeItems); xmlDoc.Save(saveFileDialog.FileName); |
1 2 3 4 5 6 7 8 9 10 | < Items > < Item > < Find >a1</ Find > < Replace >b1</ Replace > </ Item > < Item > < Find >a2</ Find > < Replace >b2</ Replace > </ Item > </ Items > |
1 2 3 4 5 6 7 8 9 10 11 | // Reading XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(openFileDialog.FileName); XmlNode nodeItems = xmlDoc.FirstChild; foreach (XmlNode nodeItem in nodeItems) { string strFind = nodeItem.FirstChild.InnerText; string strReplace = nodeItem.LastChild.InnerText; } |
Designed by sketchbooks.co.kr / sketchbook5 board skin
Sketchbook5, 스케치북5
Sketchbook5, 스케치북5
Sketchbook5, 스케치북5
Sketchbook5, 스케치북5