共用方式為


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 值為 WebContextExeContextnull

適用於

另請參閱