cmb_State_Send.ItemsSource = null;
XmlDocument doc = new XmlDocument();
doc.Load("D:\\模板\\WorkstationState_Config.xml"); //加载Xml文件
XmlElement rootElem = doc.DocumentElement; //获取根节点
XmlNode xn = rootElem.SelectSingleNode("//Workstation[@Name='" + str + "']");
if (xn != null)
{
XmlNodeList xn1 = xn.ChildNodes;
List<string> tem = new List<string>();
for (int i = ; i < xn1.Count; i++)
{
tem.Add(xn1.Item(i).InnerText);
}
if (tem.Count > )
{
cmb_State_Send.ItemsSource = tem;
cmb_State_Send.SelectedIndex = ;
}
}