This content was proof-read by Grammarly. You can Try Grammary for FREE
If you want to read the values based on the key from the web.config file in your ASP.NET application using C# , you can use the WebConfigurationManager to do it.
How to read a key from the Web.Config file in ASP.NET app using C# ?
Assume that the configuration file contains the below values
Are you a .NET Developer planning to integrate GraphQL for .NET in your Application? Check out this book BUY & DOWNLOAD GRAPHQL.NET COOKBOOK
<configuration> <appSettings> <add key="UserName" value="username"/> </appSettings> </configuration>
If you want to read the value of the key (“UserName”) , you can use the WebConfigurationManager as shown below.
string userNameValue = WebConfigurationManager.AppSettings["UserName"]