WebContext Konstruktor

Definition

Initierar en ny instans av WebContext klassen.

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)

Parametrar

site
String

Namnet på webbplatsen.

applicationPath
String

Den virtuella sökvägen till rotnivån för det aktuella webbprogrammet.

path
String

Den virtuella sökvägen för den Web.config fil som det aktuella konfigurationsobjektet representerar.

locationSubPath
String

Sökvägsvärdet för det location element som för närvarande redigeras.

appConfigPath
String

Den aktuella webbappens konfigurationssökväg.

Exempel

I följande exempel visas hur du använder den här konstruktorn. Det här kodexemplet är en del av ett större exempel för WebContext klassen.

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

Gäller för