这是我的代码:
XmlDocument doc = new XmlDocument();
foreach (string c in colorList)
{
doc.Load(@"http://whoisxmlapi.com/whoisserver/WhoisService?domainName=" + c + @"&username=user&password=pass");
textBox1.Text += doc.SelectSingleNode("WhoisRecord/registrant/email").InnerText + ",";
}
Run Code Online (Sandbox Code Playgroud)
对于第二行代码(textbox1 ...)正在生成此错误我做错了什么?
将线路分开来查看异常发生的位置怎么样?
// if node is null the problem is with SelectSingleNode
XmlNode node = doc.SelectSingleNode("WhoisRecord/registrant/email");
// if text is null the problem is with the node
string text = node.InnerText;
// if textBox1 is null the problem is with textBox1
textBox1.Text += text + ",";
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7632 次 |
| 最近记录: |