I have the below lines to read values from appsettings in app.config file. I want to handle the exceptions that might be thrown when the key is missing in app.config file. What is the best way to handle this? Thanks for any help.
processor.UserId = ConfigurationManager.AppSettings["userid"];
processor.Password = ConfigurationManager.AppSettings["password"];
<add key="userid" value ="UN"/>
<add key="password" value ="PWD"/>