Click here to Skip to main content
15,914,642 members
Home / Discussions / C#
   

C#

 
AnswerRe: want create Custom control just like MessageBox Pin
Ravi Bhavnani13-Jul-06 2:45
professionalRavi Bhavnani13-Jul-06 2:45 
QuestionCommand, Immediate window Pin
SysJey13-Jul-06 1:24
SysJey13-Jul-06 1:24 
AnswerRe: Command, Immediate window Pin
Ed.Poore15-Jul-06 12:59
Ed.Poore15-Jul-06 12:59 
QuestionWhats the best method to read the text value out of a specific XML element Pin
Red_Wizard_Shot_The_Food13-Jul-06 1:14
Red_Wizard_Shot_The_Food13-Jul-06 1:14 
AnswerRe: Whats the best method to read the text value out of a specific XML element Pin
stancrm13-Jul-06 1:32
stancrm13-Jul-06 1:32 
GeneralRe: Whats the best method to read the text value out of a specific XML element Pin
Red_Wizard_Shot_The_Food13-Jul-06 1:40
Red_Wizard_Shot_The_Food13-Jul-06 1:40 
GeneralRe: Whats the best method to read the text value out of a specific XML element Pin
stancrm13-Jul-06 1:49
stancrm13-Jul-06 1:49 
AnswerRe: Whats the best method to read the text value out of a specific XML element Pin
J4amieC13-Jul-06 2:36
J4amieC13-Jul-06 2:36 
The easiest way is with an XPath query, so if you have a simple document, say:

<Config>
 <Name>MySetting</Name>
</Config>


you would load that into an XmlDocument instance using the Load or LoadXML methods, so:

XmlDocument xmlDoc = new XmlDocument();<br />
xmlDoc.Load("C:\myConfig.xml"); // path to your config<br />
XmlNode nameTextNode = xmlDoc.DocumentElement.SelectSingleNode("Name/text()"); // or whatever xpath query you want<br />
string name = nameTextNode.Value;


You can read any value from the xml document with the correct xpath query. XPath is quite a big subject, and takes some getting used to, but there is an Xml forum here for specific path questions.

Note that the above code was written quickly and is untested, it is just to illustrate the sequence... it may not compile but should give you an idea to start playing with.


---

How to get answers to your questions[^]

GeneralRe: Whats the best method to read the text value out of a specific XML element Pin
Red_Wizard_Shot_The_Food13-Jul-06 1:40
Red_Wizard_Shot_The_Food13-Jul-06 1:40 
QuestionNeed Suggestion about handling of screen updates Pin
Rashid.Mahmood13-Jul-06 1:11
Rashid.Mahmood13-Jul-06 1:11 
AnswerRe: Need Suggestion about handling of screen updates Pin
Ed.Poore15-Jul-06 13:01
Ed.Poore15-Jul-06 13:01 
GeneralRe: Need Suggestion about handling of screen updates Pin
Rashid.Mahmood16-Jul-06 20:46
Rashid.Mahmood16-Jul-06 20:46 
GeneralRe: Need Suggestion about handling of screen updates Pin
Ed.Poore16-Jul-06 21:23
Ed.Poore16-Jul-06 21:23 
QuestionProblem with reading char from log file Pin
Yanshof13-Jul-06 1:02
Yanshof13-Jul-06 1:02 
AnswerRe: Problem with reading char from log file Pin
stancrm13-Jul-06 1:13
stancrm13-Jul-06 1:13 
GeneralThat exactly what i do - and its not working. Pin
Yanshof13-Jul-06 2:30
Yanshof13-Jul-06 2:30 
QuestionEscaping $ in code snippet Pin
Colin Angus Mackay13-Jul-06 0:29
Colin Angus Mackay13-Jul-06 0:29 
AnswerWild guess worked Pin
Colin Angus Mackay13-Jul-06 0:34
Colin Angus Mackay13-Jul-06 0:34 
QuestionAllowing a webservice to invoke a function from a windows application Pin
ZeinaBaG13-Jul-06 0:23
ZeinaBaG13-Jul-06 0:23 
Questionbinlllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll Pin
arun.m13-Jul-06 0:19
arun.m13-Jul-06 0:19 
AnswerRe: binlllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll Pin
Corinna John13-Jul-06 0:39
Corinna John13-Jul-06 0:39 
AnswerRe: binl... Pin
Ravi Bhavnani13-Jul-06 2:48
professionalRavi Bhavnani13-Jul-06 2:48 
AnswerRe: binlllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll Pin
LongRange.Shooter13-Jul-06 3:33
LongRange.Shooter13-Jul-06 3:33 
QuestionProblem with C++ wchar_t To C# ... Pin
SD312-Jul-06 23:56
SD312-Jul-06 23:56 
Questionreadonly List members Pin
GDavy12-Jul-06 23:36
GDavy12-Jul-06 23:36 

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.