C # create an xml node using winform
XmlDocument xmlDoc = new XmlDocument ();
XmlDoc. Load (Help. basePath );
XmlNode root = xmlDoc. SelectSingleNode ("control ");
XmlElement timelock = xmlDoc. CreateElement ("lock ");
XmlElement timelocksub1 = xmlDoc. CreateElement ("islock ");
Timelocksub1.InnerText = checkEditScreenshots. Checked. ToString ();
Timelock. AppendChild (timelocksub1 );
XmlElement timelocksub2 = xmlDoc. CreateElement ("locktime ");
Timelocksub2.InnerText = txtLockTime. Text. Trim ();
Timelock. AppendChild (timelocksub2 );
XmlElement timelocksub3 = xmlDoc. CreateElement ("locktimes ");
Timelocksub3.InnerText = txtLockTimes. Text. Trim ();
Timelock. AppendChild (timelocksub3 );
XmlElement timelocksub4 = xmlDoc. CreateElement ("LockRemConType ");
Timelocksub4.InnerText = Help. LockRemConType. ToString ();
Timelock. AppendChild (timelocksub4 );
XmlElement timelocksub5 = xmlDoc. CreateElement ("LockRemCon ");
Timelocksub5.InnerText = richTxtLockCon. Text. Trim ();
Timelock. AppendChild (timelocksub5 );
Root. AppendChild (timelock );
XmlDoc. Save (Help. basePath );
Help. basePath ------------------------ file storage path
Control ---------------------- Root Node
"" Is the name of the node you want to create and can be defined by yourself.
Make sure to Save xmlDoc. Save (Help. basePath );