Язык

WebContext Конструктор

Определение

Инициализирует новый экземпляр класса WebContext.

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)

Параметры

pathLevel
WebApplicationLevel

Объект WebApplicationLevel.

site
String

Имя веб-сайта.

applicationPath
String

Виртуальный путь корневого уровня текущего веб-приложения.

path
String

Виртуальный путь к файлу Web.config, который представляет текущий объект конфигурации.

locationSubPath
String

Значение location пути элемента, который в настоящее время редактируется.

appConfigPath
String

Путь конфигурации текущего веб-приложения.

Примеры

В следующем примере показано, как использовать этот конструктор. Этот пример кода является частью более крупного примера, предоставленного для WebContext класса.

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

Применяется к