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

C#

 
GeneralRe: Simple XML problem Pin
Robert Rohde18-May-05 9:21
Robert Rohde18-May-05 9:21 
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 
Thanks alot!

I will not use MessageBox to debug, thats forsure!

But i did manage to read the content another way, but im not sure if its faster or slower.

<br />
                XmlDocument doc = new XmlDocument();<br />
                doc.Load("PortSettings.xml");<br />
<br />
                XmlNode node;<br />
<br />
                //Fetch settings<br />
                node = doc.GetElementsByTagName("Port")[0];<br />
                if(node != null)<br />
                    cbConfigPorts.SelectedIndex = int.Parse(node.InnerText);<br />
<br />
                node = doc.GetElementsByTagName("StopBits")[0];<br />
                if (node != null)<br />
                    cbConfigStopBits.SelectedIndex = int.Parse(node.InnerText);<br />
<br />
                node = doc.GetElementsByTagName("Parity")[0];<br />
                if (node != null)<br />
                    cbConfigParity.SelectedIndex = int.Parse(node.InnerText);<br />
<br />
                node = doc.GetElementsByTagName("BoudRate")[0];<br />
                if (node != null)<br />
                    cbConfigBoudRate.SelectedIndex = int.Parse(node.InnerText);<br />
<br />
                node = doc.GetElementsByTagName("DataBits")[0];<br />
                if (node != null)<br />
                    cbConfigBits.SelectedIndex = int.Parse(node.InnerText);<br />
<br />
                node = doc.GetElementsByTagName("AddTimeStamp")[0];<br />
                if (node != null)<br />
                    cbConfigAddTimeStampToStream.Checked = bool.Parse(node.InnerText);<br />
<br />
                node = doc.GetElementsByTagName("SaveToFile")[0];<br />
                if (node != null)<br />
                    cbConfigSaveMainstreamToFile.Checked = bool.Parse(node.InnerText);<br />
<br />
                node = doc.GetElementsByTagName("SizeOfWindow")[0];<br />
                if (node != null)<br />
                    changeWindowSize(int.Parse(node.InnerText));<br />
<br />
                node = doc.GetElementsByTagName("MountedDisplay")[0];<br />
                if (node != null)<br />
                    incomeLoggDisplay.loggDisplayOnOff = bool.Parse(node.InnerText);<br />
<br />
                doc = null;<br />
<br />


This works good to!

Many thanks for your time!

Best Regards
SnowJim
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 
GeneralRe: WebService DataSet Help Pin
Rougy19-May-05 4:15
Rougy19-May-05 4:15 
GeneralRe: WebService DataSet Help Pin
Robert Rohde19-May-05 6:16
Robert Rohde19-May-05 6:16 
GeneralrichTextBox keyPress event problem Pin
pessen18-May-05 5:27
pessen18-May-05 5:27 
GeneralRe: richTextBox keyPress event problem Pin
S. Senthil Kumar18-May-05 5:42
S. Senthil Kumar18-May-05 5:42 
GeneralRe: richTextBox keyPress event problem Pin
pessen18-May-05 5:53
pessen18-May-05 5:53 
GeneralProblem in Opening connection in SQL Server Pin
Murtuza Husain Miyan Patel18-May-05 5:10
professionalMurtuza Husain Miyan Patel18-May-05 5:10 
GeneralRe: Problem in Opening connection in SQL Server Pin
Marc Clifton18-May-05 5:51
mvaMarc Clifton18-May-05 5:51 

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.