Created
February 11, 2011 13:25
-
-
Save svick/822332 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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