The piece of code that I'm working here is almost complete, I'm doing something wrong with a piece of repetition . Items in the list view are not separate and separate nodes in the XML file. The first item in the listView is a child node in each subsequent list. What am I doing wrong? The code is as follows:
Private Zero Button 1_Click (Object Sender, EventArgs E) {System.Xml.XmlTextWriter Author = New System.Xml.XmlTextWriter (Application.StartupPath + "\\ database.xml " , Zero); Author.WriteStartElement ("database"); For (Int i = 0; I & lt; List View 1. ITims.Count; I ++) {Authors. Merge start element ("account"); Author. Typ character string ("description", list view 1. items [i] .sbits [0]. Text); Author. Writing object string ("username", list view 1. item [s]. Sbits [1]. Text); Author. Writing attribute string ("password", list view 1. items [i] .SubItems [2]. Text); } Author. WrititeElement (); Writer.Close (); }
You have not written an end to the account element - this Should do this: for (int i = 0; i
Comments
Post a Comment