Hi..
I have checkedlistbox in Form1,i am populating it using the following code
System.IO.DirectoryInfo di = new System.IO.DirectoryInfo("E:\\Testing");
System.IO.FileSystemInfo[] files = di.GetDirectories();
checkedListBox1.Items.AddRange(files);
now i want to bulid an xml file in Form2 using the checkeditems in Form1 for which i have tried with the following code
Options opt = new Options();
XmlDocument document = new XmlDocument();
XmlElement rootElement = document.CreateElement("Items");
foreach (char itemObj in opt.checkedListBox1.CheckedItems)
{
XmlElement newItem = document.CreateElement("Item");
newItem.InnerText = itemObj.ToString();
rootElement.AppendChild(newItem);
}
document.AppendChild(rootElement);
document.Save("test.xml");
Can anyone please help me with this???