<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<DBConfig ServerIP="192.168.0.1" PortID="168" DeptID="1001"/>
</configuration>在原来的程序中我是这么读的:
public bool ReadConfig(string XMLFileName)
{
string ServerName, DataBaseName, UserName, PassWord, CStr;
ServerName = UserName = PassWord = DataBaseName = CStr = null;
if(File.Exists(XMLFileName))
{
XmlDocument xd = new XmlDocument();
xd.Load(XMLFileName);
xd.ReadNode(
TB_IP.Text = xd.SelectSingleNod("//DBConfig/@ServerIP").InnerText.Trim();
TB_Port.Text = xd.SelectSingleNode("//DBConfig/@PortID").InnerText.Trim();
TB_DeptID.Text = xd.SelectSingleNode("//DBConfig/@DeptID").InnerText.Trim();
return true;
}
else
{
return false;
}
}可是现在用xd.SelectSingleNode在精简版中不支持,各位我该怎么做???
<configuration>
<DBConfig ServerIP="192.168.0.1" PortID="168" DeptID="1001"/>
</configuration>在原来的程序中我是这么读的:
public bool ReadConfig(string XMLFileName)
{
string ServerName, DataBaseName, UserName, PassWord, CStr;
ServerName = UserName = PassWord = DataBaseName = CStr = null;
if(File.Exists(XMLFileName))
{
XmlDocument xd = new XmlDocument();
xd.Load(XMLFileName);
xd.ReadNode(
TB_IP.Text = xd.SelectSingleNod("//DBConfig/@ServerIP").InnerText.Trim();
TB_Port.Text = xd.SelectSingleNode("//DBConfig/@PortID").InnerText.Trim();
TB_DeptID.Text = xd.SelectSingleNode("//DBConfig/@DeptID").InnerText.Trim();
return true;
}
else
{
return false;
}
}可是现在用xd.SelectSingleNode在精简版中不支持,各位我该怎么做???
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货