次の方法で共有


ContextInformation.HostingContext プロパティ

定義

構成プロパティが評価されている環境のコンテキストを取得します。

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

プロパティ値

構成プロパティが評価される環境を指定するオブジェクト。

次のコード例は、 HostingContext プロパティの使用方法を示しています。

// 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)

注釈

指定できる HostingContext 値は、 WebContextExeContext、または nullです。

適用対象

こちらもご覧ください