Monday, 7 September 2015

Edit Web.config file at run time using C#


 Configuration objconf = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("~");
        AppSettingsSection app = (AppSettingsSection)objconf.GetSection("appSettings");
        if (app != null)
        {
            app.Settings["Name"].Value = "AnkitPanwar";
            objconf.Save();
        }

No comments:

Post a Comment