日期:2014-05-17 浏览次数:21227 次
private void frmMain_Load(object sender, EventArgs e)
{
EQ2008Config.GetSection();
string strpath = AppDomain.CurrentDomain.BaseDirectory + "\\StationConfig.xml";
XmlDocument doc = new XmlDocument();//初始化一个xml实例
doc.Load(strpath);//导入指定的xml文件
XmlNode no = doc.SelectSingleNode("StationList");//指定一个节点
XmlNodeList listnode = no.SelectNodes("StationData");//获取同名同级别"stationdata"节点集合
ti = new TimerCallback(ShowDataToScreenStation);
//System.Windows.Forms.Control.CheckForIllegalCrossThreadCalls = false;
foreach (XmlNode node in listnode)//遍历所有的stationdata节点
{
//Set_labelText(node);
weituo = new WeiTuo<XmlNode>(Set_labelText);
//wt = new WT_test(Test);
StartThread(node);
}
//生成已经包含的检查站的下拉菜单
foreach (StationData m in Program.listStationList)//这里在完成上面的遍历后,Program.listStationList没数据
{
ToolStripMenuItem msta = new ToolStripMenuItem(m.StatinName);
msta.Tag = m.StatinName;
msta.Click += new EventHandler(新增检测站ToolStripMenuItem_Click);
this.检测站参数设置ToolStripMenuItem.DropDownItems.Add(msta);
}
this.timRefreshData_Tick(null, null);
开始发送正常数据ToolStripMenuItem_Click(null, null);
&n