· 6 years ago · Feb 25, 2019, 09:00 PM
1<configuration>
2<appSettings file="appSettings.config">
3</appSettings>
4<system.web>
5<!-- standard web settings go here -->
6</system.web>
7</configuration>
8
9<appSettings>
10<add key="APIKey" value="YourApiKeyValue" />
11<add key="AnotherKey" value="AnotherValue" />
12</appSettings>
13
14var apiKey = ConfigurationManager.AppSettings["APIKey"];
15
16<configuration>
17 <appSettings>
18 <add key="APIKey" value="12345"/>
19 </appSettings>
20</configuration>
21
22string apiKey = ConfigurationManager.AppSettings["APIKey"];
23
24<configuration>
25 <appSettings>
26 <add key="SecretKey" value="0" />
27 </appSettings>
28</configuration>
29
30
31var secretKey = ConfigurationManager.AppSettings.Get("SecretKey");