I was wondering if its possible to put an array as a value in a key...example
<add key="email" value="emails["[email protected], [email protected]"] />
Would that syntax work?
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]" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With