I created an App.config file in my WPF application:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appsettings>
<add key="xmlDataDirectory" value="c:estdata"/>
</appsettings>
</configuration>
Then I try to read the value out with this:
string xmlDataDirectory = ConfigurationSettings.AppSettings.Get("xmlDataDirectory");
But it says this is obsolete and that I should use ConfigurationManager which I can't find, even searching in the class view.
Does anyone know how to use config files like this in WPF?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…