Opening a Configuration File

If you want to open a particular configuration file, you can use one of the Open methods exposed by the WebConfigurationManager class. For example, the page in Listing 34.11 uses the OpenMachineConfiguration() method to open the Machine.config file and display the default value for the authentication mode setting.

Listing 34.11. ShowConfigMachine.aspx

images

You can use the WebConfigurationManager class to display configuration information for other websites located on the same server. For example, the page in Listing 34.12 displays a list of all the virtual directories contained in the default website. You can select a ...

Get ASP.NET 4 Unleashed now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.