Click here to Skip to main content
15,915,702 members
Home / Discussions / C#
   

C#

 
GeneralRe: Handle without class Pin
Stefan Troschuetz2-Jan-05 11:00
Stefan Troschuetz2-Jan-05 11:00 
GeneralC# Class Member Coding Practice Poll Pin
Rocky Moore1-Jan-05 21:33
Rocky Moore1-Jan-05 21:33 
GeneralListView Pin
Blue_Skye1-Jan-05 19:17
Blue_Skye1-Jan-05 19:17 
GeneralRe: ListView Pin
Adam Goossens1-Jan-05 19:21
Adam Goossens1-Jan-05 19:21 
GeneralStop Form Copies Pin
myNameIsRon1-Jan-05 12:20
myNameIsRon1-Jan-05 12:20 
GeneralRe: Stop Form Copies Pin
TyronX1-Jan-05 12:42
TyronX1-Jan-05 12:42 
GeneralRe: Stop Form Copies Pin
Adam Goossens1-Jan-05 19:18
Adam Goossens1-Jan-05 19:18 
QuestionTypecode of an Array? Pin
TyronX1-Jan-05 10:30
TyronX1-Jan-05 10:30 
AnswerRe: Typecode of an Array? Pin
TyronX1-Jan-05 10:37
TyronX1-Jan-05 10:37 
AnswerRe: Typecode of an Array? Pin
Adam Goossens1-Jan-05 15:07
Adam Goossens1-Jan-05 15:07 
AnswerRe: Typecode of an Array? Pin
leppie1-Jan-05 17:56
leppie1-Jan-05 17:56 
Questionusing windows media format & encoder API? Pin
Member 16179991-Jan-05 9:14
Member 16179991-Jan-05 9:14 
GeneralJoystick control again Pin
TyronX1-Jan-05 4:22
TyronX1-Jan-05 4:22 
GeneralRe: Joystick control again Pin
TyronX1-Jan-05 10:05
TyronX1-Jan-05 10:05 
GeneralXml Reading in .NET 2 Pin
thepersonof1-Jan-05 4:09
thepersonof1-Jan-05 4:09 
Hi I have some xml:
<code>
<build>
<usings>
<item>System.Threading</item>
<item>System.Drawing</item>
<item>System.Windows.Forms</item>
<item>System.Diagnostics</item>
<item>System.Microsoft.DirectX</item>
<item>D3D = Microsoft.DirectX.Direct3D</item>
</usings>
<references>
<item>System.dll</item>
<item>microsoft.directx.dll</item>
<item>microsoft.directx.direct3dx.dll</item>
<item>microsoft.directx.direct3dx.dll</item>
<item>system.data.dll</item>
<item>system.drawing.dll</item>
<item>system.windows.forms.dll</item>
<item>system.xml.dll</item>
</references>
</build>
</code>

How can I read that data from each of the items in the references?

This is some code I have at the moment:
<code>
XmlTextReader reader = null;

try
{
//Load the reader with the XML file.
reader = new XmlTextReader("test.xml");

//Parse the XML and display the text content of each of the elements.
while (reader.Read())
{
if (reader.IsStartElement())
{
if (reader.IsEmptyElement)
Console.WriteLine("<{0}/>", reader.Name);
else
{
Console.Write("<{0}> ", reader.Name);
reader.Read(); //Read the start tag.
if (reader.IsStartElement()) //Handle nested elements.
Console.Write("\r\n<{0}>", reader.Name);
Console.WriteLine(reader.ReadString()); //Read the text content of the element.
}
}
}
Console.ReadLine();
reader.ReadToDescendant("usings");
reader.
Console.WriteLine(reader.Name);
Console.ReadLine();
}



finally
{
if (reader != null)
reader.Close();
}
</code>

Thanks
GeneralVisual Studio 2005 beta - an easy question Pin
McSam1-Jan-05 2:58
McSam1-Jan-05 2:58 
GeneralRe: Visual Studio 2005 beta - an easy question Pin
Robert Rohde1-Jan-05 3:23
Robert Rohde1-Jan-05 3:23 
GeneralRe: Visual Studio 2005 beta - an easy question Pin
McSam1-Jan-05 5:46
McSam1-Jan-05 5:46 
GeneralRe: Visual Studio 2005 beta - an easy question Pin
Robert Rohde1-Jan-05 6:37
Robert Rohde1-Jan-05 6:37 
GeneralRe: Visual Studio 2005 beta - an easy question Pin
Dennis C. Dietrich1-Jan-05 6:46
Dennis C. Dietrich1-Jan-05 6:46 
GeneralRe: Visual Studio 2005 beta - an easy question Pin
McSam2-Jan-05 1:13
McSam2-Jan-05 1:13 
GeneralRe: Visual Studio 2005 beta - an easy question Pin
Dennis C. Dietrich2-Jan-05 13:40
Dennis C. Dietrich2-Jan-05 13:40 
GeneralRe: Visual Studio 2005 beta - an easy question Pin
McSam3-Jan-05 4:49
McSam3-Jan-05 4:49 
GeneralRe: Visual Studio 2005 beta - an easy question Pin
Dennis C. Dietrich3-Jan-05 7:58
Dennis C. Dietrich3-Jan-05 7:58 
GeneralRe: Visual Studio 2005 beta - an easy question Pin
Dennis C. Dietrich1-Jan-05 5:43
Dennis C. Dietrich1-Jan-05 5:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.