C# 从config文件取值
int recordingCycle = int.Parse(ConfigurationManager.AppSettings["recordingCycle"]); // = 1
string collectionName = ConfigurationManager.AppSettings["collectionName"]; // = yyyyMMdd
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<appSettings file="recordingCycle">
<add key="collectionName" value="yyyyMMdd"/>
<add key="recordingCycle" value="1"/>
</appSettings>
</configuration>