Reputation: 60691
I am getting this error:
Data at the root level is invalid. Line 1, position 1.
Here's my code:
XmlDocument doc = new XmlDocument();
foreach (string c in colorList)
{
doc.LoadXml("http://whoisxmlapi.com/whoisserver/WhoisService?domainName=" +
c + "&username=user&password=pass");
textBox1.Text += doc.SelectSingleNode(
"/WhoisRecord/registrant/email").InnerText + ",";
}
Anyone know why I'm getting this exception?
I've tried to run the URL in the browser without any problems
Upvotes: 1
Views: 1844
Reputation: 4108
use doc.Load("http:...")
LoadXml
is for XML strings, not URLs
Upvotes: 11