Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static string fname = string.empty
- private static void xmlparser6(string xmldata)
- {
- XDocument xml = XDocument.Parse(xmldata);
- var q = from b in xml.Descendants("client")
- select new
- {
- fname = b.Element("firstname").Value,
- lname = b.Element("lastname").Value,
- email = b.Element("email").Value,
- };
- if (fname != "")
- {
- MessageBox.Show(fname);
- }
- }
- // XML
- <?xml version="1.0" encoding="iso-8859-7"?>
- <whmcsapi version="5.1.2">
- <client>
- <userid>1</userid>
- <id>1</id>
- <firstname>john</firstname>
- <lastname>deer</lastname>
- <companyname>that one company</companyname>
- <email>noemail@email.com</email>
- </client>
- </whmcsapi>
Add Comment
Please, Sign In to add comment