日期:2014-05-17 浏览次数:20813 次
Dictionary<int, DateTime> source = new Dictionary<int, DateTime>();
private TimerCallback ti;
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节点
{
weituo = new WeiTuo<XmlNode>(Set_labelText);
StartThread(node);
}
//下面是监控程序
Thread jiankong = new Thread(()=>{
while (true)
{
foreach(var item in source)
{
if((DateTime.Now - item.Value)>TimeSpan.FromSeconds(180))//判断超出三分钟怎么判断计时器是否刷新呢????
{
&n