Monday, December 8, 2008

How to get configuraion Settings

It is not enough to add the reference in the code. You have to manually add the reference using Add reference. If not ConfigurationManager wont visible.

using System.Collections.Specialized;
using System.Collections;
using System.Configuration;

NameValueCollection appSettings = ConfigurationManager.AppSettings;

string userName = appSettings["UserName"].ToString();

No comments: