配置文件刷新问题
private void SetConfiguration(string Appkey, string AppValue) {
XmlDocument doc = new XmlDocument();
doc.Load(Application.ExecutablePath + ".config");
XmlNode xNode;
XmlElement xElement;
xNode = doc.SelectSingleNode("//appSettings");
xElement = (XmlElement)xNode.SelectSingleNode("//add[@key='" + Appkey + "']");
xElement.SetAttribute("value", AppValue);
doc.Save(Application.ExecutablePath + ".config");
Close();
}
我写了个修改配置文件的方法,但是有个问题,假如我不退出当前应用程序的话,读取到的值仍旧是修改前的值,请问如何解决