Library tutorials & articles

Edit and Encrypt Web.Config sections using C# 2.0

Introduction

Introduction

ASP.NET 1.x allowed configurations in web.config file to be read from .NET application. But there were no options to manipulate Web.Config contents in programatically. To achieve this we had to consider Web.Config file as a normal file or an xml file. .NET 2.0 fills this gap and also provides many other useful operations to be carried out on Web.Config file; like editing and encrypting sections of Web.Config file. This articles illustrates these functionalities via a sample ASP.NET application. 

Using the code

The classes and methods to take control of the Web.Config file span across 2 namespaces.

  1. System.Configuration
  2. System.Web.Configuration

Each section in the Web.Config file has a corresponding class in either of the namespace. These classes allow modification of corresponding sections. The classes for sections within the "system.web" section are found in System.Web.Configuration. Classes for other sections that are not specific to Web.Config are found in System.Configuration.

Comments

  1. 01 Jan 1999 at 00:00

    This thread is for discussions of Edit and Encrypt Web.Config sections using C# 2.0.

Leave a comment

Sign in or Join us (it's free).

Mohammed Habeeb Mohammed Habeeb works as a software developer for an India based CMMI L5 Business Solutions Provider InApp Information Technologies situated at technopark. He holds a bachelors in Computer Science ...

Related podcasts

  • Looking into the C# Crystal Ball with Charlie Calvert and Bill Wagner

    One of the most exciting announcements from PDC was the news about C# 4.0 and Visual Studio 2010. With all the excitement and discussion throughout the event about these new developer tools, we reached out to two experts in the fields. Charlie Calvert and Bill Wagner sat down with Keith and Woody...

Events coming up

  • Mar 15

    DevWeek 2010

    London, United Kingdom

    DevWeek is Europe’s leading independent conference for software developers, database professionals and IT architects, and features expert speakers on a wide range of topics, including .NET 4.0, Silverlight 3, WCF 4, Visual Studio 2010, REST, Windows Workflow 4, Thread Synchronization, ASP.NET 4.0, SQL Server 2008 R2, LINQ, Unit Testing, CLR & C# 4.0, .NET Patterns, WPF 4, F#, Windows Azure, ADO.NET, Entity Framework, Debugging, T-SQL Tips & Tricks, and more.

We'd love to hear what you think! Submit ideas or give us feedback