Ivan Peran

Ivan Peran

  • 1.9k
  • 16
  • 304

XML LOAD - Not so sure what to do about it

Jan 10 2018 1:21 PM
Hi all
I searched a lot here for this XML and I just cant get it well.. Working on some Win form application and got stucked by that XML .. i have save and load button there.. But that load is so hard to do it..
here is my SAVE code button ( I know i dont need some code from here but i like to have all i got for a short time  so i dont need to search two times smae thing..
SaveFileDialog sfd = new SaveFileDialog();

XElement element = new XElement("Items");
foreach (var item in UsersTextbox.Items)
foreach(var item1 in PasswordTextbox.Items)
element.Add(new XElement("Name", item));

XDocument document = new XDocument();
document.Save("datasave.xml", SaveOptions.DisableFormatting); 
Problem is that. I have two listboxes of users and password.. all that needs to be saved somwhere user want.. than that save, load it up so you can log in again as same user after exiting the program. 
TY all 
p.s i saw a 5-6 Topics here of this xml but im confused as hell for that XML load.. 

Brought to you by:

Answers (1)