EnumerationOptions 생성자
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
EnumerationOptions 클래스의 새 인스턴스를 초기화합니다.
오버로드
| Name | Description |
|---|---|
| EnumerationOptions() |
기본값을 사용하여 클래스의 EnumerationOptions 새 인스턴스를 초기화합니다(기본값에 대한 개별 속성 설명 참조). 매개 변수가 없는 생성자입니다. |
| EnumerationOptions(ManagementNamedValueCollection, TimeSpan, Int32, Boolean, Boolean, Boolean, Boolean, Boolean, Boolean, Boolean) |
쿼리 또는 열거형에 사용할 클래스의 EnumerationOptions 새 인스턴스를 초기화하여 사용자가 다른 옵션에 대한 값을 지정할 수 있도록 합니다. |
EnumerationOptions()
- Source:
- ManagementOptions.cs
- Source:
- ManagementOptions.cs
- Source:
- ManagementOptions.cs
- Source:
- ManagementOptions.cs
기본값을 사용하여 클래스의 EnumerationOptions 새 인스턴스를 초기화합니다(기본값에 대한 개별 속성 설명 참조). 매개 변수가 없는 생성자입니다.
public:
EnumerationOptions();
public EnumerationOptions();
Public Sub New ()
예제
다음 예제에서는 생성자를 사용하여 변수를 EnumerationOptionsEnumerationOptions 초기화한 다음 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
- 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
예제
다음 예제에서는 생성자를 사용하여 변수를 EnumerationOptionsEnumerationOptions 초기화한 다음 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 보안
즉시 호출자에 대한 완전 신뢰입니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분적으로 신뢰할 수 있는 코드의 라이브러리 사용을 참조하세요.