To get around this, I've written the methods shown below, in the hopes that this will be useful if you have an application that requires users to add, edit, or delete database connection strings, or other such configuration data at runtime. Some of you may have noticed that accessing the .Add("key","value") throws an exception (collection is read-only). Since I didn't want to wait that long, I'm providing the following class containing four methods that will enable you to modify the App.config (or Web.config, with a few minor changes) at runtime. NET has hinted that more powerful support for modifying App.config files at runtime will come with the release of. This article will demonstrate how to add, delete, and update key value pairs in an App.config file at runtime.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |