<appSetting> <add key="UserName" value="myusername" /> <add key="Password" value="mysecretpassword" /> </appSetting>... So, you can use the following line of code to access the values:
string userName = System.Configuration.ConfigurationSettings.AppSettings["UserName"]; string password = System.Configuration.ConfigurationSettings.AppSettings["Password"];Within a try...catch block you can use userName and password to authenticate the user... If the user hasn't provided those values you can then ask for authentication.