Process.Threads 屬性
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得正在相關的處理序中執行的執行緒集。
public:
property System::Diagnostics::ProcessThreadCollection ^ Threads { System::Diagnostics::ProcessThreadCollection ^ get(); };
C#
public System.Diagnostics.ProcessThreadCollection Threads { get; }
C#
[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 類型的陣列,代表目前正在相關聯處理序中執行的作業系統執行緒。
- 屬性
這個屬性傳回的值代表最近重新整理的線程。 若要取得最新的資訊,您必須先呼叫 Refresh() 方法。
線程會在進程中執行程序代碼。 每個進程都是以單一線程啟動,其主要線程。 任何線程都可以建立其他線程。 進程內的線程會共用進程的位址空間。
使用 ProcessThread 取得與目前進程相關聯的所有線程。 主要線程不一定位於陣列中的索引零。
產品 | 版本 |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |