Add array to key in web.config

With ConfigurationManager.AppSettings you can only retrieve scalar values. For your example, if you seperate your emails with a semicolon, you can do:

string[] emails = ConfigurationManager.AppSettings["email"].Split(';');

with the web.config

<add key="email" value="[email protected];[email protected]" />

Leave a Comment