how to get xml .text using c#

VummizannaWax

New Member
here is my xml file\[code\]<TEST> <Project_Name>browser</Project_Name> <Setting BrowserKind ="Firefox" ></Setting> <ExecuteUrl>http://yahoo.com</ExecuteUrl> <caseBox> <test1>apple</test1> </caseBox></TEST>\[/code\]this xml means nothing,it's an example. I just want to make some practice.here are 3 thing i want to get:(1)Firefox(2)http://yahoo.com(3)appleI use xmldocument, but failed ,nothing I totally get.how can I get them???thanks.this is my test to get firefoxhere is my code:\[code\] XmlDocument XmlDoc = new XmlDocument( ); XmlDoc.Load(here I PLACE THE LOCATION OF FILE); XmlNodeList NodeLists = XmlDoc.SelectNodes("TEST/Setting"); foreach (XmlNode OneNode in NodeLists) { String StrAttrValue1 = OneNode.Attributes[" Browserkind "].Value; String StrAttrValue2 = OneNode.InnerText; }\[/code\]
 
Back
Top