Tuesday, March 20, 2012

Read web.config C#

web.config example:

 



CSharp (C#) Code:
public static string WebConfig(string prmKey) {
    try
    {
        string value = ConfigurationManager.AppSettings[prmKey];
        return (value);
    }
    catch {
        return ("");
    }
}

Implementation:
string GMailURL = WebConfig("DEVELOPER_URL");

Please visit: www.TyroDeveloper
Please Click on +1

No comments:

Post a Comment