WebContext Constructor

Definitie

Initialiseert een nieuw exemplaar van de WebContext klasse.

public:
 WebContext(System::Web::Configuration::WebApplicationLevel pathLevel, System::String ^ site, System::String ^ applicationPath, System::String ^ path, System::String ^ locationSubPath, System::String ^ appConfigPath);
public WebContext(System.Web.Configuration.WebApplicationLevel pathLevel, string site, string applicationPath, string path, string locationSubPath, string appConfigPath);
new System.Web.Configuration.WebContext : System.Web.Configuration.WebApplicationLevel * string * string * string * string * string -> System.Web.Configuration.WebContext
Public Sub New (pathLevel As WebApplicationLevel, site As String, applicationPath As String, path As String, locationSubPath As String, appConfigPath As String)

Parameters

site
String

De naam van de website.

applicationPath
String

Het virtuele pad van het hoofdniveau van de huidige webtoepassing.

path
String

Het virtuele pad van het Web.config bestand dat het huidige configuratieobject vertegenwoordigt.

locationSubPath
String

De padwaarde van het location element dat momenteel wordt bewerkt.

appConfigPath
String

Het configuratiepad van de huidige webtoepassing.

Voorbeelden

In het volgende voorbeeld ziet u hoe u deze constructor gebruikt. Dit codevoorbeeld maakt deel uit van een groter voorbeeld voor de WebContext klasse.

// Get the context.
WebContext webContext = (WebContext)config.EvaluationContext.HostingContext;
' Get the context.
Dim webContext As WebContext = config.EvaluationContext.HostingContext

Van toepassing op