Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Write List to XML and back
Message
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
Write List to XML and back
Environment versions
Environment:
C# 4.0
OS:
Windows 10
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01628791
Message ID:
01628791
Views:
42
Hi,

I have been Googling for this question and find many suggestions but none that I understand and see simple.

I have a List (example below) and I want it to create an XML file and save it in a folder.
List<string> MyList = new List<string>();
MyList.Add( "ABC" );
MyList.Add( "CBS" );
MyList.Add( "NBC" );

// Now I want to write the above list to an XML that will look like this:
<?xml version="1.0"?>
<Choices>
        <Channel>ABC</Channel>
        <Channel>CBS</Channel>
        <Channel>NBC</Channel>
</Choices>
TIA for any suggestions.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Next
Reply
Map
View

Click here to load this message in the networking platform