War diese Seite hilfreich?
Ihr Feedback ist uns wichtig. Teilen Sie uns Ihre Meinung mit.
Weiteres Feedback?
1500 verbleibende Zeichen
VirtualDirectoryDefaults-Klasse
Collapse the table of content
Expand the table of content

VirtualDirectoryDefaults-Klasse

Aktualisiert: November 2007

Defines the default values for virtual directories that are created for an application or Web site.

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

public sealed class VirtualDirectoryDefaults : ConfigurationElement
public final class VirtualDirectoryDefaults extends ConfigurationElement
public final class VirtualDirectoryDefaults extends ConfigurationElement

This class is sealed and does not implement a public constructor. You can access an instance of the VirtualDirectoryDefaults class through the VirtualDirectoryDefaults property of the Site class or the VirtualDirectoryDefaults property of the Application class.

The following example lists the virtual directory defaults for all applications under the Default Web Site node.

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Web.Administration;
using Microsoft.Web.Management;

namespace AdministrationSnippets
{
    public class AdministrationApplicationVirtualDirectoryDefaults
    {


...


// Returns a list of the virtual directory defaults for all 
// applications under the default Web site.
public void GetVirtualDirectoryDefaults()
{
    ServerManager manager = new ServerManager();
    Site defaultSite = manager.Sites["Default Web Site"];
    foreach (Application app in defaultSite.Applications)
    {
        Console.WriteLine(
            "Found application with the following path: {0}", app.Path);
        Console.WriteLine("Virtual Directory Defaults:");
        if (app.VirtualDirectories.Count > 0)
        {
            Console.WriteLine("  Attributes");
            foreach (string prop in 
                app.VirtualDirectoryDefaults.RawAttributes.Keys)
            {
                Console.WriteLine("   |-{0}: {1}", prop.PadRight(20),
                    app.VirtualDirectoryDefaults.GetAttribute(prop).Value);
            }
        }
    }
}


...


    }
}


System.Object
  Microsoft.Web.Administration.ConfigurationElement
    Microsoft.Web.Administration.VirtualDirectoryDefaults

Alle öffentlichen static (Shared in Visual Basic)-Member dieses Typs sind threadsicher. Bei Instanzmembern ist die Threadsicherheit nicht gewährleistet.

Windows Vista, Windows XP SP2, Windows Server 2003

.NET Framework und .NET Compact Framework unterstützen nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen für .NET Framework.

.NET Framework

Unterstützt in: 3.5, 3.0

Community-Beiträge

HINZUFÜGEN
Anzeigen:
© 2015 Microsoft