mattisflones
asked on
How to read a appSetting C#
Hi.
I have a section in web.config like this:
<appSettings>
<add key="mailServer" value="localhost" />
<add key="mailFromAddress" value="testmail@test.serve r" />
</appSettings>
How do i read the values?
All the examples i can find is for looping through the values, and thats not what i want.. i need to read one value.
I have a section in web.config like this:
<appSettings>
<add key="mailServer" value="localhost" />
<add key="mailFromAddress" value="testmail@test.serve
</appSettings>
How do i read the values?
All the examples i can find is for looping through the values, and thats not what i want.. i need to read one value.
ASKER
Nope.. that makes .NET respond with:
"CS0118: 'System.Configuration.Conf igurationS ettings.Ap pSettings' is a 'property' but is used like a 'method'"
"CS0118: 'System.Configuration.Conf
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Oh for Fks sake... :-)
When will i ever remember that diff. from VB..
Thanks a million!
When will i ever remember that diff. from VB..
Thanks a million!
String mailServerValue=Configurat
similarly
String mailFromAddress=Configurat