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

C#

 
GeneralRe: c# program to find the version& language Pin
ziczaczoom200418-May-05 10:54
ziczaczoom200418-May-05 10:54 
GeneralRe: c# program to find the version& language Pin
DavidNohejl18-May-05 11:01
DavidNohejl18-May-05 11:01 
GeneralRe: c# program to find the version& language Pin
DavidNohejl18-May-05 11:18
DavidNohejl18-May-05 11:18 
QuestionPropertyGrid: creating custom type converters and run-time attribute changes? Pin
Blazej Stompel18-May-05 9:29
Blazej Stompel18-May-05 9:29 
GeneralSimple XML problem Pin
Snowjim18-May-05 8:24
Snowjim18-May-05 8:24 
GeneralRe: Simple XML problem Pin
Snowjim18-May-05 8:26
Snowjim18-May-05 8:26 
GeneralRe: Simple XML problem Pin
Snowjim18-May-05 11:37
Snowjim18-May-05 11:37 
GeneralRe: Simple XML problem Pin
Robert Rohde18-May-05 9:21
Robert Rohde18-May-05 9:21 
Im not 100% sure but I think the ReadElementString function also calls Read internally. Thus every call of this function will result in making the reader moving forward twice.
You could do something like this (although there is probably a more elegant solution):

xTR = new XmlTextReader("PortSettings.xml");
xTR.MoveToContent();

ArrayList neededElements = new ArrayList();
neededElements.Add("Port");
neededElements.Add("StopBits");
neededElements.Add("Parity");
neededElements.Add("BoudRate");
neededElements.Add("DataBits");
neededElements.Add("AddTimeStamp");
neededElements.Add("SaveToFile");
neededElements.Add("SizeOfWindow");
neededElements.Add("MountedDisplay");

while (xTR.Read())
{
if (xTR.NodeType == XmlNodeType.Element)
{
if (neededElements.Contains(xTR.Name)) {
MessageBox.Show(xTR.Name + " : " + xTR.Value);
}
}
}
xTR.Close();


(I only added the ArrayList thing to keep the code short Wink | ;) )
GeneralRe: Simple XML problem Pin
DavidNohejl18-May-05 10:22
DavidNohejl18-May-05 10:22 
GeneralRe: Simple XML problem Pin
Snowjim18-May-05 11:34
Snowjim18-May-05 11:34 
GeneralRe: Simple XML problem Pin
leppie18-May-05 9:40
leppie18-May-05 9:40 
GeneralRe: Simple XML problem Pin
DavidNohejl18-May-05 10:28
DavidNohejl18-May-05 10:28 
GeneralRe: Simple XML problem Pin
Snowjim18-May-05 11:26
Snowjim18-May-05 11:26 
GeneralRe: Simple XML problem Pin
DavidNohejl18-May-05 12:34
DavidNohejl18-May-05 12:34 
GeneralRe: Simple XML problem Pin
Snowjim18-May-05 12:44
Snowjim18-May-05 12:44 
GeneralRe: Simple XML problem Pin
DavidNohejl18-May-05 13:26
DavidNohejl18-May-05 13:26 
GeneralRe: Simple XML problem Pin
Snowjim18-May-05 13:31
Snowjim18-May-05 13:31 
GeneralReusing a local port when sending from a bound socket Pin
ghassett2218-May-05 7:28
ghassett2218-May-05 7:28 
QuestionC# 'static' variables on the web? Pin
LizardWiz18-May-05 7:05
LizardWiz18-May-05 7:05 
AnswerRe: C# 'static' variables on the web? Pin
S. Senthil Kumar18-May-05 7:24
S. Senthil Kumar18-May-05 7:24 
AnswerRe: C# 'static' variables on the web? Pin
S Sansanwal18-May-05 12:09
S Sansanwal18-May-05 12:09 
AnswerRe: C# 'static' variables on the web? Pin
Joshua Nussbaum18-May-05 14:21
Joshua Nussbaum18-May-05 14:21 
GeneralWebService DataSet Help Pin
Rougy18-May-05 5:29
Rougy18-May-05 5:29 
GeneralRe: WebService DataSet Help Pin
Robert Rohde18-May-05 8:40
Robert Rohde18-May-05 8:40 
GeneralRe: WebService DataSet Help Pin
Rougy19-May-05 4:10
Rougy19-May-05 4:10 

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.