日期:2014-05-18 浏览次数:20866 次
<?xml version="1.0" encoding="utf-8" ?> <MailList> <OnList>abc@gmail.com</OnList> </MailList>
private void button1_Click(object sender, EventArgs e) { XmlDocument xdMailList = new XmlDocument(); xdMailList.Load(@"MailList.xml"); // textBox_ServerName.Text = document.SelectSingleNode("/travianBOT/settinginfo").Attributes["server"].Value; label1.Text = xdMailList.SelectSingleNode("MailList").Attributes["OnList"].Value.ToString(); }
private void button1_Click(object sender, EventArgs e) { XmlDocument xdMailList = new XmlDocument(); xdMailList.Load(@"MailList.xml"); // textBox_ServerName.Text = document.SelectSingleNode("/travianBOT/settinginfo").Attributes["server"].Value; label1.Text = xdMailList.SelectSingleNode("/MailList/OnList").InnerText; }
------解决方案--------------------
Attributes是属性~~~~~