scampercat

scampercat

  • NA
  • 189
  • 0

C# various values in app.config

Nov 6 2012 10:30 AM
In a C#  2008 application, I have code like what is listed below.

Thread.CurrentPrincipal.IsInRole(Environment.UserDomainName + "\\" + "Role")

I want to change the code so the "role" value is obtained from the app.config file instead of having a hard-coded  value of "role".

Thus can you show me some code how I can obtain the "Role" value from the app.config file instead of using hard-coded values?

Answers (2)