ManagementObjectCollection ManagementObjectCollection ManagementObjectCollection ManagementObjectCollection Class


表示經由 WMI 所擷取的各種管理物件集合。Represents different collections of management objects retrieved through WMI. 這個集合中的物件屬於 ManagementBaseObject 所衍生的型別,其中包括 ManagementObjectManagementClassThe objects in this collection are of ManagementBaseObject-derived types, including ManagementObject and ManagementClass. 集合可以是執行 WMI 查詢 (經由 ManagementObjectSearcher) 的結果,或指定型別 (經由表示該型別的 ManagementClass 所擷取) 之管理物件的列舉型別 (Enumeration)。The collection can be the result of a WMI query executed through a ManagementObjectSearcher, or an enumeration of management objects of a specified type retrieved through a ManagementClass representing that type. 此外,還可以是在指定方面與特定管理物件相關聯的管理物件集合;在這種情況下,集合將會經由例如 GetRelated() 這樣的方法來擷取。In addition, this can be a collection of management objects related in a specified way to a specific management object - in this case the collection would be retrieved through a method such as GetRelated(). 集合可以使用 ManagementObjectCollection.ManagementObjectEnumerator 來輕鬆運用,而其中物件也可以因應各種管理工作加以檢查或操作。The collection can be walked using the ManagementObjectCollection.ManagementObjectEnumerator and objects in it can be inspected or manipulated for various management tasks.

public ref class ManagementObjectCollection : IDisposable, System::Collections::ICollection
public class ManagementObjectCollection : IDisposable, System.Collections.ICollection
type ManagementObjectCollection = class
    interface ICollection
    interface IEnumerable
    interface IDisposable
Public Class ManagementObjectCollection
Implements ICollection, IDisposable


Count Count Count Count

取得值,表示集合中物件的數目。Gets a value indicating the number of objects in the collection.

IsSynchronized IsSynchronized IsSynchronized IsSynchronized

取得值,指出是否會同步處理物件 (安全執行緒)。Gets a value that indicates whether the object is synchronized (thread-safe).

SyncRoot SyncRoot SyncRoot SyncRoot

取得要用於同步處理的物件。Gets the object to be used for synchronization.


CopyTo(Array, Int32) CopyTo(Array, Int32) CopyTo(Array, Int32) CopyTo(Array, Int32)

將集合複製至陣列。Copies the collection to an array.

CopyTo(ManagementBaseObject[], Int32) CopyTo(ManagementBaseObject[], Int32) CopyTo(ManagementBaseObject[], Int32) CopyTo(ManagementBaseObject[], Int32)

將集合中的項目複製至 ManagementBaseObject 陣列。Copies the items in the collection to a ManagementBaseObject array.

Dispose() Dispose() Dispose() Dispose()

釋出與這個物件相關聯的資源。Releases resources associated with this object. 在呼叫這個方法之後,嘗試使用這個物件時,會導致 ObjectDisposedException 被擲回。After this method has been called, an attempt to use this object will result in an ObjectDisposedException being thrown.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(Inherited from Object)
Finalize() Finalize() Finalize() Finalize()

處置物件所保有的資源。Disposes of resources the object is holding. 這是物件的解構函式。This is the destructor for the object. 完成項會使用解構函式語法來表示。Finalizers are expressed using destructor syntax.

GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

傳回集合的列舉值。Returns the enumerator for the collection.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(Inherited from Object)


IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator()

傳回透過 IEnumerator 重複的 ManagementObjectCollectionReturns an IEnumerator that iterates through the ManagementObjectCollection.

Extension Methods

Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable)

IEnumerable 的項目轉換成指定的型別。Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable)

根據指定的型別來篩選 IEnumerable 的項目。Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable)

啟用查詢的平行化作業。Enables parallelization of a query.

AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable)

將轉換IEnumerableIQueryableConverts an IEnumerable to an IQueryable.