i just got an account at:
http://www.whoisxmlapi.com/index.php#/whois-api-doc.php?rid=1
ive never parsed XML with c#, how would i get the information in the <email>
tag ?
i just got an account at:
http://www.whoisxmlapi.com/index.php#/whois-api-doc.php?rid=1
ive never parsed XML with c#, how would i get the information in the <email>
tag ?
I would check out using Linq to XML
Querying Xml: http://msdn.microsoft.com/en-us/library/bb308960.aspx#xlinqoverview_topic3a
I know of three options:
XmlDocument example:
XmlDocument doc = new XmlDocument();
doc.LoadXml(xml);
string email = doc.SelectSingleNode("/WhoisRecord/registrant/email").InnerText;
XmlReader example:
using (XmlReader reader = new XmlTextReader(new StringReader(xml)))
{
reader.Read();
reader.ReadStartElement("WhoisRecord");
reader.ReadStartElement("registrant");
reader.ReadStartElement("email");
reader.ReadString().Dump();
}