Need a Code Example of XML in C#

R

redlightpacket

I need some C# code to read the stuff in a file. I want to display the
question in a text box. I want the answers to display in a label. Like
"LabelA, LableB, LabelC, LabelD". I also want it so I can skip to
specific question numbers in the xml file like "<question = 000002>" so
I can bring up different kinds of questions.


<quelist>
<question = 000001>
<quetext>
Who is the richest person in the world?
</quetext>
<que = 000001 answer = A>
A. Bill Gates
</que>
<que = 000001 answer = B>
B. Larry Ellsion
</que>
<que = 000001 answer = C>
C. Bill Ford
</que>
<que = 000001 answer = D>
D. Sam Walton
</que>
</question>
<question = 000002>
<quetext>
Who is the richest person in the world?
</quetext>
<que = 000002 answer = A>
A. Bill Gates
</que>
<que = 000002 answer = B>
B. Larry Ellsion
</que>
<que = 000002 answer = C>
C. Bill Ford
</que>
<que = 000002 answer = D>
D. Sam Walton
</que>
</question>
</quelist>

The xml stuff below is another thing I want code to. I need some C#
code to write data to a xml file in the format below. Thanks for your
help...

<anslist>
<ans = 000001>
A
</ans>
</anslist>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,007
Messages
2,570,266
Members
46,864
Latest member
DaniEbswor

Latest Threads

Top