EnumerationOptions 생성자

정의

EnumerationOptions 클래스의 새 인스턴스를 초기화합니다.

오버로드

EnumerationOptions()

기본값을 사용하여 EnumerationOptions 클래스의 새 인스턴스를 초기화합니다. 기본값에 대한 자세한 내용은 개별 속성에 대한 설명을 참조하십시오. 이는 매개 변수가 없는 생성자입니다.

EnumerationOptions(ManagementNamedValueCollection, TimeSpan, Int32, Boolean, Boolean, Boolean, Boolean, Boolean, Boolean, Boolean)

쿼리 또는 열거형에 사용할 EnumerationOptions 클래스의 새 인스턴스를 초기화하여 사용자가 여러 옵션에 대한 값을 지정할 수 있도록 합니다.

EnumerationOptions()

Source:
ManagementOptions.cs
Source:
ManagementOptions.cs
Source:
ManagementOptions.cs

기본값을 사용하여 EnumerationOptions 클래스의 새 인스턴스를 초기화합니다. 기본값에 대한 자세한 내용은 개별 속성에 대한 설명을 참조하십시오. 이는 매개 변수가 없는 생성자입니다.

public:
 EnumerationOptions();
public EnumerationOptions ();
Public Sub New ()

예제

다음 예제에서는 초기화를 EnumerationOptions 변수는 EnumerationOptions 생성자 및 WMI 클래스와 해당 하위 클래스의 인스턴스를 모두 가져옵니다.

using System;
using System.Management;
public class RemoteConnect
{
    public static void Main()
    {
        EnumerationOptions opt = new EnumerationOptions();
        // Will enumerate instances of the given class
        // and any subclasses.
        opt.EnumerateDeep = true;
        ManagementClass c = new ManagementClass("CIM_Service");
        foreach (ManagementObject o in c.GetInstances(opt))
            Console.WriteLine(o["Name"]);
    }
}
Imports System.Management
Public Class RemoteConnect

    Public Overloads Shared Function Main( _
    ByVal args() As String) As Integer

        Dim opt As New EnumerationOptions
        ' Will enumerate instances of the given class
        ' and any subclasses.
        opt.EnumerateDeep = True
        Dim mngmtClass As New ManagementClass("CIM_Service")
        Dim o As ManagementObject
        For Each o In mngmtClass.GetInstances(opt)
            Console.WriteLine(o("Name"))
        Next o

        Return 0
    End Function
End Class

설명

.NET Framework 보안

직접 실행 호출자의 경우 완전히 신뢰합니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분적으로 신뢰할 수 있는 코드에서 라이브러리를 사용 하 여입니다.

적용 대상

EnumerationOptions(ManagementNamedValueCollection, TimeSpan, Int32, Boolean, Boolean, Boolean, Boolean, Boolean, Boolean, Boolean)

Source:
ManagementOptions.cs
Source:
ManagementOptions.cs
Source:
ManagementOptions.cs

쿼리 또는 열거형에 사용할 EnumerationOptions 클래스의 새 인스턴스를 초기화하여 사용자가 여러 옵션에 대한 값을 지정할 수 있도록 합니다.

public:
 EnumerationOptions(System::Management::ManagementNamedValueCollection ^ context, TimeSpan timeout, int blockSize, bool rewindable, bool returnImmediatley, bool useAmendedQualifiers, bool ensureLocatable, bool prototypeOnly, bool directRead, bool enumerateDeep);
public EnumerationOptions (System.Management.ManagementNamedValueCollection context, TimeSpan timeout, int blockSize, bool rewindable, bool returnImmediatley, bool useAmendedQualifiers, bool ensureLocatable, bool prototypeOnly, bool directRead, bool enumerateDeep);
new System.Management.EnumerationOptions : System.Management.ManagementNamedValueCollection * TimeSpan * int * bool * bool * bool * bool * bool * bool * bool -> System.Management.EnumerationOptions
Public Sub New (context As ManagementNamedValueCollection, timeout As TimeSpan, blockSize As Integer, rewindable As Boolean, returnImmediatley As Boolean, useAmendedQualifiers As Boolean, ensureLocatable As Boolean, prototypeOnly As Boolean, directRead As Boolean, enumerateDeep As Boolean)

매개 변수

context
ManagementNamedValueCollection

공급자에게 전달될 수 있는 공급자별 정보를 포함하는 옵션 컨텍스트 개체입니다.

timeout
TimeSpan

결과를 열거하기 위한 시간 제한 값입니다.

blockSize
Int32

WMI에서 한 번에 검색할 항목 수입니다.

rewindable
Boolean

결과 집합을 되감아 여러 번 이동할 수 있게 하려면 true이고, 그렇지 않으면 false입니다.

returnImmediatley
Boolean

해당 작업에서 결과를 즉시 반환하도록 하거나(반동기식) 모든 결과가 준비되기 전에는 중지되도록 하려면 true이고, 그렇지 않으면 false입니다.

useAmendedQualifiers
Boolean

반환된 개체가 수정된(로캘을 인식하는) 한정자를 포함하도록 지정하려면 true이고, 그렇지 않으면 false입니다.

ensureLocatable
Boolean

반환된 모든 개체에 올바른 경로가 있어야 하면 true이고, 그렇지 않으면 false입니다.

prototypeOnly
Boolean

실제 결과 대신 결과 집합의 프로토타입을 반환하려면 true이고, 그렇지 않으면 false입니다.

directRead
Boolean

지정된 클래스의 개체만 검색하거나 파생된 클래스에서도 검색하려면 true이고, 그렇지 않으면 false입니다.

enumerateDeep
Boolean

서브클래스에서 재귀적 열거형을 사용하려면 true이고, 그렇지 않으면 false입니다.

예제

다음 예제에서는 초기화를 EnumerationOptions 변수는 EnumerationOptions 생성자 및 WMI 클래스와 해당 하위 클래스의 인스턴스를 모두 가져옵니다.

using System;
using System.Management;
public class RemoteConnect
{
    public static void Main()
    {
        EnumerationOptions opt = new EnumerationOptions(
            null, System.TimeSpan.MaxValue,
            1, true, true, false,
            true, false, false, true);

        ManagementClass c = new ManagementClass("CIM_Service");
        foreach (ManagementObject o in c.GetInstances(opt))
            Console.WriteLine(o["Name"]);
    }
}
Imports System.Management
Public Class RemoteConnect

    Public Overloads Shared Function Main( _
    ByVal args() As String) As Integer

        Dim opt As EnumerationOptions
        Opt = New EnumerationOptions( _
            Nothing, System.TimeSpan.MaxValue, _
            1, True, True, False, _
            True, False, False, True)

        Dim mngmtClass As New ManagementClass("CIM_Service")
        Dim o As ManagementObject
        For Each o In mngmtClass.GetInstances(opt)
            Console.WriteLine(o("Name"))
        Next o

        Return 0
    End Function
End Class

설명

.NET Framework 보안

직접 실행 호출자의 경우 완전히 신뢰합니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분적으로 신뢰할 수 있는 코드에서 라이브러리를 사용 하 여입니다.

적용 대상