Share via


ContextInformation.HostingContext Özellik

Tanım

Yapılandırma özelliğinin değerlendirildiği ortamın bağlamını alır.

public:
 property System::Object ^ HostingContext { System::Object ^ get(); };
public object HostingContext { get; }
member this.HostingContext : obj
Public ReadOnly Property HostingContext As Object

Özellik Değeri

Yapılandırma özelliğinin değerlendirildiği ortamı belirten bir nesne.

Örnekler

Aşağıdaki kod örneği özelliğinin HostingContext nasıl kullanılacağını gösterir.

// Create an object based on HostingContext.
WebContext myWC =
  (WebContext)config.EvaluationContext.HostingContext;
// Use the WebContext object to determine
// the ApplicationLevel.
Console.WriteLine("ApplicationLevel: {0}",
  myWC.ApplicationLevel);
' Create an object based on HostingContext.
Dim myWC As WebContext = _
  config.EvaluationContext.HostingContext
' Use the WebContext object to determine
' the ApplicationLevel.
Console.WriteLine("ApplicationLevel: {0}", _
  myWC.ApplicationLevel)

Açıklamalar

Olası HostingContext değer , ExeContextveya nullşeklindedirWebContext.

Şunlara uygulanır

Ayrıca bkz.