語言

AutomationElement.GetRuntimeId 方法

定義

擷取指派給使用者介面(UI)項目的唯一識別碼。

public:
 cli::array <int> ^ GetRuntimeId();
public int[] GetRuntimeId();
member this.GetRuntimeId : unit -> int[]
Public Function GetRuntimeId () As Integer()

傳回

Int32[]

一個整數陣列,代表執行時識別碼。

例外狀況

該介面 AutomationElement 已經不存在了。

範例

以下範例展示如何取得執行時識別碼 AutomationElement。

// element is an AutomationElement.
int[] id = element.GetRuntimeId();
' element is an AutomationElement.
Dim id As Integer() = element.GetRuntimeId()

備註

識別碼僅保證對其產生桌面的使用者介面唯一。 識別碼可以隨時間重複使用。

執行時識別碼的格式可能會在未來版本中有所改變。 回傳的識別碼應視為不透明值,僅用於比較;例如,判斷 an AutomationElement 是否在快取中。

適用於