-
July 30th, 2011, 10:12 AM
#1
XML parsing takes too long
hi, when i try to output the values within a xml from an url in a console window, it stucks at xml.Read(); for about 20 seconds, however, i sent the test build to a friend, and it only takes 1 sec for him, what could possibly be the cause of this prolonged delay?
code snip:
Code:
string partialurl = "http://statapi.transformice.com/miceinfo.xml?n=";
Console.Write("Name: ");
string mousename = Console.ReadLine();
string fullurl = partialurl + mousename;
Console.Write("URL will be: ");
Console.WriteLine(fullurl);
XmlTextReader xml = new XmlTextReader(fullurl);
xml.Read(); // Hangs at this location!
xml.ReadStartElement("mice");
xml.ReadStartElement("name");
Console.Write("Name: ");
Console.WriteLine(xml.ReadString());
xml.ReadEndElement();
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|