C# ASMX - How to read a Username
and Password from Web.config

  1. In your Web.config - add the <appSettings>  section


  1. In your code, add the following


string FaxCoreUsername = System.Configuration.ConfigurationManager.AppSettings["FaxCoreUsername"];
string FaxCorePassword = System.Configuration.ConfigurationManager.AppSettings["FaxCorePassword"];


  1. You can now use the FaxCoreUsername and FaxCorePassword to authenticate


long userID = faxSender.AuthenticateUser(FaxCoreUsername, FaxCorePassword);

Comments

Popular posts from this blog

C# - Simple Class Library and how to use it in another project

AWS CLI - INSTALLATION AND CONFIGURATION

Upload a file to a Web server in ASP.NET by using Visual C# .NET