我如何验证表单加载上的 XML 文件?(XML 文件为空)
private void Form1_Load(object sender, EventArgs e)
{
// --------------- Read XML File / Data: Settings_General
String xmlfile = "Settings_General.xml";
XmlDocument doc = new XmlDocument();
doc.Load(xmlfile);
XmlNode comboBox4Value = doc.SelectSingleNode("XMLFILE/Active");
if (comboBox4Value != null)
{
comboBox4.SelectedIndex = Convert.ToInt32(comboBox4Value.InnerText);
}
}