Process.Threads 屬性

定義

取得正在相關的處理序中執行的執行緒集。

public:
 property System::Diagnostics::ProcessThreadCollection ^ Threads { System::Diagnostics::ProcessThreadCollection ^ get(); };
public System.Diagnostics.ProcessThreadCollection Threads { get; }
[System.ComponentModel.Browsable(false)]
public System.Diagnostics.ProcessThreadCollection Threads { get; }
member this.Threads : System.Diagnostics.ProcessThreadCollection
[<System.ComponentModel.Browsable(false)>]
member this.Threads : System.Diagnostics.ProcessThreadCollection
Public ReadOnly Property Threads As ProcessThreadCollection

屬性值

ProcessThread 類型的陣列,代表目前正在相關聯處理序中執行的作業系統執行緒。

屬性

例外狀況

處理序沒有 Id,或沒有與 Process 執行個體關聯的處理序。

-或-

關聯處理序已結束。

備註

這個屬性傳回的值代表最近重新整理的線程。 若要取得最新的資訊,您必須先呼叫 Refresh() 方法。

線程會在進程中執行程序代碼。 每個進程都是以單一線程啟動,其主要線程。 任何線程都可以建立其他線程。 進程內的線程會共用進程的位址空間。

使用 ProcessThread 取得與目前進程相關聯的所有線程。 主要線程不一定位於陣列中的索引零。

適用於

另請參閱