ApplicationInfo 類別

定義

提供執行應用程式的相關資訊。 此類別無法獲得繼承。

public ref class ApplicationInfo sealed
[System.Serializable]
public sealed class ApplicationInfo
[<System.Serializable>]
type ApplicationInfo = class
Public NotInheritable Class ApplicationInfo
繼承
ApplicationInfo
屬性

範例

下列程式碼範例會從 ApplicationManager 與目前進程相關聯的 物件取得 物件的陣列 ApplicationInfo


<%@ Page Language="C#" %>
<%@ Import Namespace="System.Web.Hosting" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
  protected void Page_PreRender(object sender, EventArgs e)
  {
    ApplicationManager appManager = ApplicationManager.GetApplicationManager();
    ApplicationInfo [] appInfo = appManager.GetRunningApplications();
    GridView1.DataSource = appInfo;
    GridView1.DataBind();
  }
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
  <meta http-equiv="Content-Type" content="text/html" />
  <title>Application Info sample</title>
</head>
<body>
  <form id="form1" runat="server">
    <asp:GridView ID="GridView1" runat="server">
    </asp:GridView>
  </form>
</body>
</html>
<%@ Page Language="VB" %>
<%@ Import Namespace="System.Web.Hosting" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
  Protected Sub Page_PreRender(ByVal sender As Object, ByVal e As EventArgs)
    Dim appManager As ApplicationManager
    appManager = ApplicationManager.GetApplicationManager()
   
    Dim appInfo As ApplicationInfo()
    appInfo = appManager.GetRunningApplications()
    
    GridView1.DataSource = appInfo
    GridView1.DataBind()
  End Sub
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
  <meta http-equiv="Content-Type" content="text/html" />
  <title>Untitled Page</title>
</head>
<body>
  <form id="form1" runat="server">
    <asp:GridView ID="GridView1" runat="server">
    </asp:GridView>
  </form>
</body>
</html>

備註

類別 ApplicationInfoApplicationManager 使用 物件來取得執行中應用程式的相關資訊。

屬性

ID

取得應用程式的唯一識別項。

PhysicalPath

取得與應用程式根目錄對應的實體路徑。

VirtualPath

取得與應用程式根目錄對應的虛擬路徑。

方法

Equals(Object)

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetType()

取得目前執行個體的 Type

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。

(繼承來源 Object)

適用於