protected void readconfig()
{
try
System.Xml.XmlDocument mXmlDoc=new System.Xml.XmlDocument();
mXmlDoc.Load(Server.MapPath(configfilepath));
nettype=mXmlDoc.SelectNodes("//Root/Nettype")[0].InnerText; totalnum=int.Parse(mXmlDoc.SelectNodes("//Root/Totalnum")[0].InnerText);
//读出列数
cells=int.Parse(mXmlDoc.SelectNodes("//Root/Cells")[0].InnerText);
XmlNodeList mXmlNodes=mXmlDoc.SelectNodes("//Root/IPlink");
foreach(XmlNode IPlinkchildlNode in mXmlNodes)
//得到序列号
int icount=int.Parse(IPlinkchildlNode.ChildNodes[2].InnerText);
//根据序列号,将测量点的名称放入名称数组相应的位置上
namestr[icount]=IPlinkchildlNode.ChildNodes[0].InnerText;
//根据序列号,将测量点的IP放入IP数组相应的位置上
ipstr[icount]=IPlinkchildlNode.ChildNodes[1].InnerText;
}
catch
errmessage.InnerHtml="<table align=center><tr>
<td align=left><font color=red>不能读取配置文件,可能的错误是<br>"+"1、配置文件不存在<br>"+
"2、配置文件内容被损坏"+
"</font></td></tr></table>";
上一页 [1] [2] [3] 下一页
Copyright @ 2007-2012 敏韬网(敏而好学,文韬武略--MinTao.Net)(学习笔记) Inc All Rights Reserved. 闵涛 E_mail:admin@mintao.net(欢迎提供学习资源)
鄂公网安备 42011102001154号
站长:MinTao ICP备案号:鄂ICP备11006601号-18