Application.VirtualDirectoryDefaults Property

IIS 7.0

Gets the default values that are assigned to all virtual directories of the application.

Namespace:   Microsoft.Web.Administration
Assembly:  Microsoft.Web.Administration (in Microsoft.Web.Administration.dll)

public VirtualDirectoryDefaults VirtualDirectoryDefaults { get; }

Property Value

Type: Microsoft.Web.Administration.VirtualDirectoryDefaults

A VirtualDirectoryDefaults object that represents the default values that are assigned to all newly created virtual directories of the application.

Although the VirtualDirectoryDefaults property is read-only, the values in the collection returned allow for both reading and writing. After you change a value in the collection, you must use the CommitChanges method of a ServerManager object to write the values to the configuration system.

The following example returns a list of the virtual directory default values for the applications under the default Web site.

The following example creates a new application, sets the virtual directory defaults, creates two new virtual directories, and then displays the new virtual directory values.

Return to top