共用方式為


HttpApplicationState.StaticObjects 屬性

定義

取得 <object> 標記宣告的所有物件,該標記的範圍設定為 ASP.NET 應用程式內的 "Application"。

public:
 property System::Web::HttpStaticObjectsCollection ^ StaticObjects { System::Web::HttpStaticObjectsCollection ^ get(); };
public System.Web.HttpStaticObjectsCollection StaticObjects { get; }
member this.StaticObjects : System.Web.HttpStaticObjectsCollection
Public ReadOnly Property StaticObjects As HttpStaticObjectsCollection

屬性值

HttpStaticObjectsCollection

網頁上物件的集合。

範例

下列範例會取得變數中的所有應用程式物件 HttpStaticObjectsCollection ,而且只有在物件數目大於 0 時,才會執行常式。

HttpStaticObjectsCollection PageObjects;

PageObjects = Application.StaticObjects;
if (PageObjects.Count > 0)
{
   //...
}
Dim PageObjects As HttpStaticObjectsCollection
 
PageObjects = Application.StaticObjects
If PageObjects.Count > 0 Then
   '...
End If

備註

應用程式物件是在標記內的 Global.asax 檔案中 <object runat="server" scope="Application"> </object> 定義。

適用於