Skip to content

Instantly share code, notes, and snippets.

@svick
Created February 11, 2011 13:25
Show Gist options
  • Save svick/822332 to your computer and use it in GitHub Desktop.
Save svick/822332 to your computer and use it in GitHub Desktop.
using System;
using System.Net;
using System.Xml;
using System.Linq;
public class Test
{
public static void Main()
{
Console.Write("ICO: ");
int ico;
if (!int.TryParse(Console.ReadLine(), out ico))
Console.WriteLine("chyba");
string url = "http://wwwinfo.mfcr.cz/cgi-bin/ares/darv_std.cgi?ico=" + ico.ToString();
var wc = new WebClient();
var xml = wc.DownloadString(url);
var doc = new XmlDocument();
doc.LoadXml(xml);
var nm = new XmlNamespaceManager(doc.NameTable);
nm.AddNamespace("are", "http://wwwinfo.mfcr.cz/ares/xml_doc/schemas/ares/ares_answer/v_1.0.1");
var elem = doc.SelectSingleNode("//are:Obchodni_firma", nm);
Console.WriteLine(elem.InnerText);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment