0
我創建了一個名爲「samplesApp.config」的新配置文件,如下所示。如何從新配置文件讀取值
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="IDNUMBER" value="1200"/>
</appSettings>
</configuration>
我試圖從上面的配置文件中讀取值,如圖所示。但它沒有使用C#
string port = ConfigurationManager.AppSettings["IDNUMBER"];
的[裝入自定義配置文件(可能的複製http://stackoverflow.com/questions/ 505566/loading-custom-configuration-files) –
調用你的文件'app.config'或'web.config'。或者你打算把它稱爲'samplesApp.config'? – Daniel