Prosim, netusite nekdo proc me toto hazi na radku StreamReader ... security chybu ?
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();
WebClient wc = new WebClient();
wc.OpenReadCompleted += wc_OpenReadCompleted;
wc.OpenReadAsync(new Uri("http://wwwinfo.mfcr.cz/cgi-bin/ares/darv_or.cgi?ico=27074358", UriKind.Absolute));
}
private void wc_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e)
{
StreamReader myReader = new StreamReader(e.Result);
string res = myReader.ReadLine();
XmlReader reader = XmlReader.Create(res);
reader.MoveToContent();
while (reader.Read())
{
if (reader.NodeType == XmlNodeType.Element && reader.Name == "D:OF")
{
listBox1.Items.Add(new ListBoxItem()
{
Content = reader.GetAttribute("last") + ", " + reader.GetAttribute("first") + " (" + reader.ReadInnerXml() + ")"
});
}
}
reader.Close();
}
}
Predem diky za radu !