ContextInformation.HostingContext Properti

Definisi

Mendapatkan konteks lingkungan tempat properti konfigurasi sedang dievaluasi.

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

Nilai Properti

Objek yang menentukan lingkungan tempat properti konfigurasi sedang dievaluasi.

Contoh

Contoh kode berikut menunjukkan cara menggunakan HostingContext properti .

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

Keterangan

Nilai yang mungkin HostingContext adalah WebContext, ExeContext, atau null.

Berlaku untuk

Lihat juga