ManagementClass 생성자
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
ManagementClass 클래스의 새 인스턴스를 초기화합니다.
오버로드
| Name | Description |
|---|---|
| ManagementClass() |
ManagementClass 클래스의 새 인스턴스를 초기화합니다. 매개 변수가 없는 생성자입니다. |
| ManagementClass(ManagementPath) |
ManagementClass 클래스의 새 인스턴스를 초기화합니다. 이 클래스는 디스크 드라이브를 나타낼 수 있는 Win32_LogicalDisk, Notepad.exe 같은 프로세스를 나타내는 Win32_Process 같은 WMI의 CIM(Common Information Model) 관리 클래스를 나타냅니다. |
| ManagementClass(String) |
지정된 경로로 초기화된 클래스의 ManagementClass 새 인스턴스를 초기화합니다. 이 클래스는 디스크 드라이브를 나타낼 수 있는 Win32_LogicalDisk, Notepad.exe 같은 프로세스를 나타내는 Win32_Process 같은 WMI의 CIM(Common Information Model) 관리 클래스를 나타냅니다. |
| ManagementClass(ManagementPath, ObjectGetOptions) |
지정된 옵션을 사용하여 지정된 WMI 클래스 경로로 초기화된 클래스의 ManagementClass 새 인스턴스를 초기화합니다. 이 클래스는 디스크 드라이브를 나타낼 수 있는 Win32_LogicalDisk, Notepad.exe 같은 프로세스를 나타내는 Win32_Process 같은 WMI의 CIM(Common Information Model) 관리 클래스를 나타냅니다. |
| ManagementClass(SerializationInfo, StreamingContext) |
지정된 클래스 인스턴스에서 클래스의 ManagementClass 새 인스턴스를 SerializationInfoStreamingContext 초기화합니다. |
| ManagementClass(String, ObjectGetOptions) |
지정된 옵션을 사용하여 지정된 WMI 클래스 경로로 초기화된 클래스의 ManagementClass 새 인스턴스를 초기화합니다. 이 클래스는 디스크 드라이브를 나타낼 수 있는 Win32_LogicalDisk, Notepad.exe 같은 프로세스를 나타내는 Win32_Process 같은 WMI의 CIM(Common Information Model) 관리 클래스를 나타냅니다. |
| ManagementClass(ManagementScope, ManagementPath, ObjectGetOptions) |
지정된 범위 및 지정된 옵션을 사용하여 지정된 WMI 클래스에 대한 클래스의 새 인스턴스 ManagementClass 를 초기화합니다. 이 클래스는 디스크 드라이브를 나타낼 수 있는 Win32_LogicalDisk, Notepad.exe 같은 프로세스를 나타내는 Win32_Process 같은 WMI의 CIM(Common Information Model) 관리 클래스를 나타냅니다. |
| ManagementClass(String, String, ObjectGetOptions) |
지정된 WMI 클래스, 지정된 범위 및 지정된 옵션을 사용하여 클래스의 새 인스턴스 ManagementClass 를 초기화합니다. 이 클래스는 디스크 드라이브를 나타낼 수 있는 Win32_LogicalDisk, Notepad.exe 같은 프로세스를 나타내는 Win32_Process 같은 WMI의 CIM(Common Information Model) 관리 클래스를 나타냅니다. |
설명
.NET Framework 보안
즉시 호출자에 대한 완전 신뢰입니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분적으로 신뢰할 수 있는 코드의 라이브러리 사용을 참조하세요.
ManagementClass()
ManagementClass 클래스의 새 인스턴스를 초기화합니다. 매개 변수가 없는 생성자입니다.
public:
ManagementClass();
public ManagementClass();
Public Sub New ()
예제
다음 예제는 매개 변수가 없는 생성자를 사용하여 변수를 ManagementClass 초기화하는 방법의 ManagementClass 예입니다. 이 예제에서는 만든 클래스에 대한 메서드, 속성 및 한정자를 나열합니다.
using System;
using System.Management;
public class Sample
{
public static void Main()
{
// Get the WMI class
ManagementClass processClass =
new ManagementClass();
processClass.Path = new
ManagementPath("Win32_Process");
// Get the methods in the class
MethodDataCollection methods =
processClass.Methods;
// display the methods
Console.WriteLine("Method Names: ");
foreach (MethodData method in methods)
{
Console.WriteLine(method.Name);
}
Console.WriteLine();
// Get the properties in the class
PropertyDataCollection properties =
processClass.Properties;
// display the properties
Console.WriteLine("Property Names: ");
foreach (PropertyData property in properties)
{
Console.WriteLine(property.Name);
}
Console.WriteLine();
// Get the Qualifiers in the class
QualifierDataCollection qualifiers =
processClass.Qualifiers;
// display the qualifiers
Console.WriteLine("Qualifier Names: ");
foreach (QualifierData qualifier in qualifiers)
{
Console.WriteLine(qualifier.Name);
}
}
}
Imports System.Management
Class Sample
Public Overloads Shared Function _
Main(ByVal args() As String) As Integer
' Get the WMI class
Dim processClass As New ManagementClass
processClass.Path = New _
ManagementPath("Win32_Process")
' Get the methods in the class
Dim methods As MethodDataCollection
methods = processClass.Methods
' display the methods
Console.WriteLine("Method Names: ")
For Each method As MethodData In methods
Console.WriteLine(method.Name)
Next
Console.WriteLine()
' Get the properties in the class
Dim properties As PropertyDataCollection
properties = processClass.Properties
' display the properties
Console.WriteLine("Property Names: ")
For Each p As PropertyData In properties
Console.WriteLine(p.Name)
Next
Console.WriteLine()
' Get the Qualifiers in the class
Dim qualifiers As QualifierDataCollection = _
processClass.Qualifiers()
' display the qualifiers
Console.WriteLine("Qualifier Names: ")
For Each qualifier As QualifierData In qualifiers
Console.WriteLine(qualifier.Name)
Next
End Function
End Class
설명
.NET Framework 보안
즉시 호출자에 대한 완전 신뢰입니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분적으로 신뢰할 수 있는 코드의 라이브러리 사용을 참조하세요.
적용 대상
ManagementClass(ManagementPath)
ManagementClass 클래스의 새 인스턴스를 초기화합니다. 이 클래스는 디스크 드라이브를 나타낼 수 있는 Win32_LogicalDisk, Notepad.exe 같은 프로세스를 나타내는 Win32_Process 같은 WMI의 CIM(Common Information Model) 관리 클래스를 나타냅니다.
public:
ManagementClass(System::Management::ManagementPath ^ path);
public ManagementClass(System.Management.ManagementPath path);
new System.Management.ManagementClass : System.Management.ManagementPath -> System.Management.ManagementClass
Public Sub New (path As ManagementPath)
매개 변수
- path
- ManagementPath
ManagementPath 바인딩할 WMI 클래스를 지정하는 A. 매개 변수는 WMI 클래스 경로를 지정해야 합니다. 클래스는 WMI의 CIM 관리 클래스를 나타냅니다. CIM 클래스는 하드웨어, 소프트웨어, 프로세스 등을 비롯한 관리 정보를 나타냅니다. Windows 사용할 수 있는 CIM 클래스에 대한 자세한 내용은 CIM 클래스 참조하세요.
예제
다음 예제는 생성자를 사용하여 변수를 ManagementClass 초기화하는 방법의 예입니다 ManagementClass . 이 예제에서는 만든 클래스에 대한 메서드, 속성 및 한정자를 나열합니다.
using System;
using System.Management;
public class Sample
{
public static void Main()
{
// Get the WMI class
ManagementClass c = new ManagementClass(
new ManagementPath("Win32_LogicalDisk"));
// Get the methods in the class
MethodDataCollection methods =
c.Methods;
// display the methods
Console.WriteLine("Method Names: ");
foreach (MethodData method in methods)
{
Console.WriteLine(method.Name);
}
Console.WriteLine();
// Get the properties in the class
PropertyDataCollection properties =
c.Properties;
// display the properties
Console.WriteLine("Property Names: ");
foreach (PropertyData property in properties)
{
Console.WriteLine(property.Name);
}
Console.WriteLine();
// Get the Qualifiers in the class
QualifierDataCollection qualifiers =
c.Qualifiers;
// display the qualifiers
Console.WriteLine("Qualifier Names: ");
foreach (QualifierData qualifier in qualifiers)
{
Console.WriteLine(qualifier.Name);
}
}
}
Imports System.Management
Class Sample
Public Overloads Shared Function _
Main(ByVal args() As String) As Integer
' Get the WMI class
Dim c As New ManagementClass( _
New ManagementPath("Win32_LogicalDisk"))
' Get the methods in the class
Dim methods As MethodDataCollection
methods = c.Methods
' display the methods
Console.WriteLine("Method Names: ")
For Each method As MethodData In methods
Console.WriteLine(method.Name)
Next
Console.WriteLine()
' Get the properties in the class
Dim properties As PropertyDataCollection
properties = c.Properties
' display the properties
Console.WriteLine("Property Names: ")
For Each p As PropertyData In properties
Console.WriteLine(p.Name)
Next
Console.WriteLine()
' Get the Qualifiers in the class
Dim qualifiers As QualifierDataCollection = _
c.Qualifiers()
' display the qualifiers
Console.WriteLine("Qualifier Names: ")
For Each qualifier As QualifierData In qualifiers
Console.WriteLine(qualifier.Name)
Next
End Function
End Class
설명
매개 변수는 path WMI 클래스 경로를 지정해야 합니다.
.NET Framework 보안
즉시 호출자에 대한 완전 신뢰입니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분적으로 신뢰할 수 있는 코드의 라이브러리 사용을 참조하세요.
적용 대상
ManagementClass(String)
지정된 경로로 초기화된 클래스의 ManagementClass 새 인스턴스를 초기화합니다. 이 클래스는 디스크 드라이브를 나타낼 수 있는 Win32_LogicalDisk, Notepad.exe 같은 프로세스를 나타내는 Win32_Process 같은 WMI의 CIM(Common Information Model) 관리 클래스를 나타냅니다.
public:
ManagementClass(System::String ^ path);
public ManagementClass(string path);
new System.Management.ManagementClass : string -> System.Management.ManagementClass
Public Sub New (path As String)
매개 변수
- path
- String
WMI 클래스의 경로입니다. 클래스는 WMI의 CIM 관리 클래스를 나타냅니다. CIM 클래스는 하드웨어, 소프트웨어, 프로세스 등을 비롯한 관리 정보를 나타냅니다. Windows 사용할 수 있는 CIM 클래스에 대한 자세한 내용은 CIM 클래스 참조하세요.
예제
다음 예제에서는 생성자를 사용하여 변수 ManagementClass 를 ManagementClass 초기화하는 방법을 보여줍니다. 이 예제에서는 만든 클래스에 대한 메서드, 속성 및 한정자를 나열합니다.
using System;
using System.Management;
public class Sample
{
public static void Main()
{
// Get the WMI class
ManagementClass c =
new ManagementClass("Win32_LogicalDisk");
// Get the methods in the class
MethodDataCollection methods =
c.Methods;
// display the methods
Console.WriteLine("Method Names: ");
foreach (MethodData method in methods)
{
Console.WriteLine(method.Name);
}
Console.WriteLine();
// Get the properties in the class
PropertyDataCollection properties =
c.Properties;
// display the properties
Console.WriteLine("Property Names: ");
foreach (PropertyData property in properties)
{
Console.WriteLine(property.Name);
}
Console.WriteLine();
// Get the Qualifiers in the class
QualifierDataCollection qualifiers =
c.Qualifiers;
// display the qualifiers
Console.WriteLine("Qualifier Names: ");
foreach (QualifierData qualifier in qualifiers)
{
Console.WriteLine(qualifier.Name);
}
}
}
Imports System.Management
Class Sample
Public Overloads Shared Function _
Main(ByVal args() As String) As Integer
' Get the WMI class
Dim c As New ManagementClass("Win32_LogicalDisk")
' Get the methods in the class
Dim methods As MethodDataCollection
methods = c.Methods
' display the methods
Console.WriteLine("Method Names: ")
For Each method As MethodData In methods
Console.WriteLine(method.Name)
Next
Console.WriteLine()
' Get the properties in the class
Dim properties As PropertyDataCollection
properties = c.Properties
' display the properties
Console.WriteLine("Property Names: ")
For Each p As PropertyData In properties
Console.WriteLine(p.Name)
Next
Console.WriteLine()
' Get the Qualifiers in the class
Dim qualifiers As QualifierDataCollection = _
c.Qualifiers()
' display the qualifiers
Console.WriteLine("Qualifier Names: ")
For Each qualifier As QualifierData In qualifiers
Console.WriteLine(qualifier.Name)
Next
End Function
End Class
설명
.NET Framework 보안
즉시 호출자에 대한 완전 신뢰입니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분적으로 신뢰할 수 있는 코드의 라이브러리 사용을 참조하세요.
적용 대상
ManagementClass(ManagementPath, ObjectGetOptions)
지정된 옵션을 사용하여 지정된 WMI 클래스 경로로 초기화된 클래스의 ManagementClass 새 인스턴스를 초기화합니다. 이 클래스는 디스크 드라이브를 나타낼 수 있는 Win32_LogicalDisk, Notepad.exe 같은 프로세스를 나타내는 Win32_Process 같은 WMI의 CIM(Common Information Model) 관리 클래스를 나타냅니다.
public:
ManagementClass(System::Management::ManagementPath ^ path, System::Management::ObjectGetOptions ^ options);
public ManagementClass(System.Management.ManagementPath path, System.Management.ObjectGetOptions options);
new System.Management.ManagementClass : System.Management.ManagementPath * System.Management.ObjectGetOptions -> System.Management.ManagementClass
Public Sub New (path As ManagementPath, options As ObjectGetOptions)
매개 변수
- path
- ManagementPath
ManagementPath WMI 클래스 경로를 나타내는 인스턴스입니다. 클래스는 WMI의 CIM 관리 클래스를 나타냅니다. CIM 클래스는 하드웨어, 소프트웨어, 프로세스 등을 비롯한 관리 정보를 나타냅니다. Windows 사용할 수 있는 CIM 클래스에 대한 자세한 내용은 CIM 클래스 참조하세요.
- options
- ObjectGetOptions
ObjectGetOptions 이 클래스를 검색할 때 사용할 옵션을 나타내는 값입니다.
예제
다음 예제는 생성자를 사용하여 변수를 ManagementClass 초기화하는 방법의 예입니다 ManagementClass . 이 예제에서는 만든 클래스에 대한 메서드, 속성 및 한정자(수정된 한정자 포함)를 나열합니다.
using System;
using System.Management;
public class Sample
{
public static void Main()
{
// Get the WMI class
ManagementPath p =
new ManagementPath("Win32_Process");
// Options specify that amended qualifiers
// are to be retrieved along with the class
ObjectGetOptions o = new ObjectGetOptions(
null, System.TimeSpan.MaxValue, true);
ManagementClass c = new ManagementClass(p,o);
// Get the methods in the class
MethodDataCollection methods =
c.Methods;
// display the methods
Console.WriteLine("Method Names: ");
foreach (MethodData method in methods)
{
Console.WriteLine(method.Name);
}
Console.WriteLine();
// Get the properties in the class
PropertyDataCollection properties =
c.Properties;
// display the properties
Console.WriteLine("Property Names: ");
foreach (PropertyData property in properties)
{
Console.WriteLine(property.Name);
}
Console.WriteLine();
// Get the Qualifiers in the class
QualifierDataCollection qualifiers =
c.Qualifiers;
// display the qualifiers
Console.WriteLine("Qualifier Names: ");
foreach (QualifierData qualifier in qualifiers)
{
Console.WriteLine(qualifier.Name);
}
}
}
Imports System.Management
Class Sample
Public Overloads Shared Function _
Main(ByVal args() As String) As Integer
' Get the WMI class
Dim p As New ManagementPath("Win32_Process")
' Options specify that amended qualifiers
' are to be retrieved along with the class
Dim o As New ObjectGetOptions( _
Nothing, System.TimeSpan.MaxValue, True)
Dim c As New ManagementClass(p, o)
' Get the methods in the class
Dim methods As MethodDataCollection
methods = c.Methods
' display the methods
Console.WriteLine("Method Names: ")
For Each method As MethodData In methods
Console.WriteLine(method.Name)
Next
Console.WriteLine()
' Get the properties in the class
Dim properties As PropertyDataCollection
properties = c.Properties
' display the properties
Console.WriteLine("Property Names: ")
For Each pdata As PropertyData In properties
Console.WriteLine(pdata.Name)
Next
Console.WriteLine()
' Get the Qualifiers in the class
Dim qualifiers As QualifierDataCollection = _
c.Qualifiers()
' display the qualifiers
Console.WriteLine("Qualifier Names: ")
For Each qualifier As QualifierData In qualifiers
Console.WriteLine(qualifier.Name)
Next
End Function
End Class
설명
.NET Framework 보안
즉시 호출자에 대한 완전 신뢰입니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분적으로 신뢰할 수 있는 코드의 라이브러리 사용을 참조하세요.
적용 대상
ManagementClass(SerializationInfo, StreamingContext)
지정된 클래스 인스턴스에서 클래스의 ManagementClass 새 인스턴스를 SerializationInfoStreamingContext 초기화합니다.
protected:
ManagementClass(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);
protected ManagementClass(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
new System.Management.ManagementClass : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Management.ManagementClass
Protected Sub New (info As SerializationInfo, context As StreamingContext)
매개 변수
- info
- SerializationInfo
새 ManagementClass항목을 serialize하는 데 필요한 정보를 포함하는 클래스의 인스턴스 SerializationInfo 입니다.
- context
- StreamingContext
새 ManagementClass스트림과 연결된 serialize된 스트림의 원본을 포함하는 클래스의 인스턴스 StreamingContext 입니다.
설명
.NET Framework 보안
즉시 호출자에 대한 완전 신뢰입니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분적으로 신뢰할 수 있는 코드의 라이브러리 사용을 참조하세요.
적용 대상
ManagementClass(String, ObjectGetOptions)
지정된 옵션을 사용하여 지정된 WMI 클래스 경로로 초기화된 클래스의 ManagementClass 새 인스턴스를 초기화합니다. 이 클래스는 디스크 드라이브를 나타낼 수 있는 Win32_LogicalDisk, Notepad.exe 같은 프로세스를 나타내는 Win32_Process 같은 WMI의 CIM(Common Information Model) 관리 클래스를 나타냅니다.
public:
ManagementClass(System::String ^ path, System::Management::ObjectGetOptions ^ options);
public ManagementClass(string path, System.Management.ObjectGetOptions options);
new System.Management.ManagementClass : string * System.Management.ObjectGetOptions -> System.Management.ManagementClass
Public Sub New (path As String, options As ObjectGetOptions)
매개 변수
- path
- String
WMI 클래스의 경로입니다. 클래스는 WMI의 CIM 관리 클래스를 나타냅니다. CIM 클래스는 하드웨어, 소프트웨어, 프로세스 등을 비롯한 관리 정보를 나타냅니다. Windows 사용할 수 있는 CIM 클래스에 대한 자세한 내용은 CIM 클래스 참조하세요.
- options
- ObjectGetOptions
ObjectGetOptions WMI 클래스를 검색할 때 사용할 옵션을 나타내는 값입니다.
예제
다음 예제에서는 생성자를 사용하여 변수 ManagementClass 를 ManagementClass 초기화하는 방법을 보여줍니다. 이 예제에서는 만든 클래스에 대한 메서드, 속성 및 한정자(수정된 한정자 포함)를 나열합니다.
using System;
using System.Management;
public class Sample
{
public static void Main()
{
// Get the WMI class
//Options specify that amended qualifiers
// should be retrieved along with the class
ObjectGetOptions o = new ObjectGetOptions(
null, System.TimeSpan.MaxValue, true);
ManagementClass c =
new ManagementClass("Win32_ComputerSystem",o);
// Get the methods in the class
MethodDataCollection methods =
c.Methods;
// display the methods
Console.WriteLine("Method Names: ");
foreach (MethodData method in methods)
{
Console.WriteLine(method.Name);
}
Console.WriteLine();
// Get the properties in the class
PropertyDataCollection properties =
c.Properties;
// display the properties
Console.WriteLine("Property Names: ");
foreach (PropertyData property in properties)
{
Console.WriteLine(property.Name);
}
Console.WriteLine();
// Get the Qualifiers in the class
QualifierDataCollection qualifiers =
c.Qualifiers;
// display the qualifiers
Console.WriteLine("Qualifier Names: ");
foreach (QualifierData qualifier in qualifiers)
{
Console.WriteLine(qualifier.Name);
}
}
}
Imports System.Management
Class Sample
Public Overloads Shared Function _
Main(ByVal args() As String) As Integer
' Get the WMI class
' Options specify that amended qualifiers
' should be retrieved along with the class
Dim o As New ObjectGetOptions( _
Nothing, System.TimeSpan.MaxValue, True)
Dim c As New ManagementClass("Win32_ComputerSystem", o)
' Get the methods in the class
Dim methods As MethodDataCollection
methods = c.Methods
' display the methods
Console.WriteLine("Method Names: ")
For Each method As MethodData In methods
Console.WriteLine(method.Name)
Next
Console.WriteLine()
' Get the properties in the class
Dim properties As PropertyDataCollection
properties = c.Properties
' display the properties
Console.WriteLine("Property Names: ")
For Each p As PropertyData In properties
Console.WriteLine(p.Name)
Next
Console.WriteLine()
' Get the Qualifiers in the class
Dim qualifiers As QualifierDataCollection = _
c.Qualifiers()
' display the qualifiers
Console.WriteLine("Qualifier Names: ")
For Each qualifier As QualifierData In qualifiers
Console.WriteLine(qualifier.Name)
Next
End Function
End Class
설명
.NET Framework 보안
즉시 호출자에 대한 완전 신뢰입니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분적으로 신뢰할 수 있는 코드의 라이브러리 사용을 참조하세요.
적용 대상
ManagementClass(ManagementScope, ManagementPath, ObjectGetOptions)
지정된 범위 및 지정된 옵션을 사용하여 지정된 WMI 클래스에 대한 클래스의 새 인스턴스 ManagementClass 를 초기화합니다. 이 클래스는 디스크 드라이브를 나타낼 수 있는 Win32_LogicalDisk, Notepad.exe 같은 프로세스를 나타내는 Win32_Process 같은 WMI의 CIM(Common Information Model) 관리 클래스를 나타냅니다.
public:
ManagementClass(System::Management::ManagementScope ^ scope, System::Management::ManagementPath ^ path, System::Management::ObjectGetOptions ^ options);
public ManagementClass(System.Management.ManagementScope scope, System.Management.ManagementPath path, System.Management.ObjectGetOptions options);
new System.Management.ManagementClass : System.Management.ManagementScope * System.Management.ManagementPath * System.Management.ObjectGetOptions -> System.Management.ManagementClass
Public Sub New (scope As ManagementScope, path As ManagementPath, options As ObjectGetOptions)
매개 변수
- scope
- ManagementScope
WMI 클래스가 있는 범위(서버 및 네임스페이스)를 지정하는 A ManagementScope 입니다.
- path
- ManagementPath
ManagementPath 지정된 범위에서 WMI 클래스의 경로를 나타내는 A입니다. 클래스는 WMI의 CIM 관리 클래스를 나타냅니다. CIM 클래스는 하드웨어, 소프트웨어, 프로세스 등을 비롯한 관리 정보를 나타냅니다. Windows 사용할 수 있는 CIM 클래스에 대한 자세한 내용은 CIM 클래스 참조하세요.
- options
- ObjectGetOptions
ObjectGetOptions WMI 클래스를 검색할 때 사용할 옵션을 지정하는 값입니다.
예제
다음 예제는 생성자를 사용하여 변수를 ManagementClass 초기화하는 방법의 예입니다 ManagementClass . 이 예제에서는 만든 클래스에 대한 메서드, 속성 및 한정자(수정된 한정자 포함)를 나열합니다. 예제가 컴퓨터에서 올바르게 실행되도록 코드의 범위(네임스페이스)를 변경해야 합니다.
using System;
using System.Management;
public class Sample
{
public static void Main()
{
// Get the WMI class
ManagementScope s =
new ManagementScope("\\\\MyBox\\root\\cimv2");
ManagementPath p = new ManagementPath("Win32_Environment");
ObjectGetOptions o = new ObjectGetOptions(
null, System.TimeSpan.MaxValue, true);
ManagementClass c = new ManagementClass(s, p, o);
// Get the methods in the class
MethodDataCollection methods =
c.Methods;
// display the methods
Console.WriteLine("Method Names: ");
foreach (MethodData method in methods)
{
Console.WriteLine(method.Name);
}
Console.WriteLine();
// Get the properties in the class
PropertyDataCollection properties =
c.Properties;
// display the properties
Console.WriteLine("Property Names: ");
foreach (PropertyData property in properties)
{
Console.WriteLine(property.Name);
}
Console.WriteLine();
// Get the Qualifiers in the class
QualifierDataCollection qualifiers =
c.Qualifiers;
// display the qualifiers
Console.WriteLine("Qualifier Names: ");
foreach (QualifierData qualifier in qualifiers)
{
Console.WriteLine(qualifier.Name);
}
}
}
Imports System.Management
Class Sample
Public Overloads Shared Function _
Main(ByVal args() As String) As Integer
' Get the WMI class
Dim s As New ManagementScope("\\MyBox\root\cimv2")
Dim p As New ManagementPath("Win32_Environment")
Dim o As New ObjectGetOptions( _
Nothing, System.TimeSpan.MaxValue, True)
Dim c As New ManagementClass(s, p, o)
' Get the methods in the class
Dim methods As MethodDataCollection
methods = c.Methods
' display the methods
Console.WriteLine("Method Names: ")
For Each method As MethodData In methods
Console.WriteLine(method.Name)
Next
Console.WriteLine()
' Get the properties in the class
Dim properties As PropertyDataCollection
properties = c.Properties
' display the properties
Console.WriteLine("Property Names: ")
Dim data As PropertyData
For Each data In properties
Console.WriteLine(data.Name)
Next
Console.WriteLine()
' Get the Qualifiers in the class
Dim qualifiers As QualifierDataCollection = _
c.Qualifiers()
' display the qualifiers
Console.WriteLine("Qualifier Names: ")
For Each qualifier As QualifierData In qualifiers
Console.WriteLine(qualifier.Name)
Next
End Function
End Class
설명
경로는 전체 경로(서버 및 네임스페이스 포함)로 지정할 수 있습니다. 그러나 범위가 지정된 경우 전체 경로의 첫 번째 부분을 재정의합니다.
.NET Framework 보안
즉시 호출자에 대한 완전 신뢰입니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분적으로 신뢰할 수 있는 코드의 라이브러리 사용을 참조하세요.
적용 대상
ManagementClass(String, String, ObjectGetOptions)
지정된 WMI 클래스, 지정된 범위 및 지정된 옵션을 사용하여 클래스의 새 인스턴스 ManagementClass 를 초기화합니다. 이 클래스는 디스크 드라이브를 나타낼 수 있는 Win32_LogicalDisk, Notepad.exe 같은 프로세스를 나타내는 Win32_Process 같은 WMI의 CIM(Common Information Model) 관리 클래스를 나타냅니다.
public:
ManagementClass(System::String ^ scope, System::String ^ path, System::Management::ObjectGetOptions ^ options);
public ManagementClass(string scope, string path, System.Management.ObjectGetOptions options);
new System.Management.ManagementClass : string * string * System.Management.ObjectGetOptions -> System.Management.ManagementClass
Public Sub New (scope As String, path As String, options As ObjectGetOptions)
매개 변수
- scope
- String
WMI 클래스가 있는 범위입니다.
- path
- String
지정된 범위 내의 WMI 클래스에 대한 경로입니다. 클래스는 WMI의 CIM 관리 클래스를 나타냅니다. CIM 클래스는 하드웨어, 소프트웨어, 프로세스 등을 비롯한 관리 정보를 나타냅니다. Windows 사용할 수 있는 CIM 클래스에 대한 자세한 내용은 CIM 클래스 참조하세요.
- options
- ObjectGetOptions
ObjectGetOptions WMI 클래스를 검색할 때 사용할 옵션을 지정하는 값입니다.
예제
다음 예제에서는 생성자를 사용하여 변수 ManagementClass 를 ManagementClass 초기화하는 방법을 보여줍니다. 이 예제에서는 만든 클래스에 대한 메서드, 속성 및 한정자(수정된 한정자 포함)를 나열합니다. 예제가 컴퓨터에서 올바르게 실행되도록 코드의 범위(네임스페이스)를 변경해야 합니다.
using System;
using System.Management;
public class Sample
{
public static void Main()
{
// Get the WMI class
//Options specify that amended qualifiers
// should be retrieved along with the class
ManagementClass c =
new ManagementClass("\\\\MyBox\\root\\cimv2",
"Win32_Environment",
new ObjectGetOptions(
null, System.TimeSpan.MaxValue, true));
// Get the methods in the class
MethodDataCollection methods =
c.Methods;
// display the methods
Console.WriteLine("Method Names: ");
foreach (MethodData method in methods)
{
Console.WriteLine(method.Name);
}
Console.WriteLine();
// Get the properties in the class
PropertyDataCollection properties =
c.Properties;
// display the properties
Console.WriteLine("Property Names: ");
foreach (PropertyData property in properties)
{
Console.WriteLine(property.Name);
}
Console.WriteLine();
// Get the Qualifiers in the class
QualifierDataCollection qualifiers =
c.Qualifiers;
// display the qualifiers
Console.WriteLine("Qualifier Names: ");
foreach (QualifierData qualifier in qualifiers)
{
Console.WriteLine(qualifier.Name);
}
}
}
Imports System.Management
Class Sample
Public Overloads Shared Function _
Main(ByVal args() As String) As Integer
' Get the WMI class
' Options specify that amended qualifiers
' should be retrieved along with the class
Dim c As New ManagementClass("\\MyBox\root\cimv2", _
"Win32_Environment", _
New ObjectGetOptions( _
Nothing, System.TimeSpan.MaxValue, True))
' Get the methods in the class
Dim methods As MethodDataCollection
methods = c.Methods
' display the methods
Console.WriteLine("Method Names: ")
For Each method As MethodData In methods
Console.WriteLine(method.Name)
Next
Console.WriteLine()
' Get the properties in the class
Dim properties As PropertyDataCollection
properties = c.Properties
' display the properties
Console.WriteLine("Property Names: ")
For Each p As PropertyData In properties
Console.WriteLine(p.Name)
Next
Console.WriteLine()
' Get the Qualifiers in the class
Dim qualifiers As QualifierDataCollection = _
c.Qualifiers()
' display the qualifiers
Console.WriteLine("Qualifier Names: ")
For Each qualifier As QualifierData In qualifiers
Console.WriteLine(qualifier.Name)
Next
End Function
End Class
설명
경로는 전체 경로(서버 및 네임스페이스 포함)로 지정할 수 있습니다. 그러나 범위가 지정된 경우 전체 경로의 첫 번째 부분을 재정의합니다.
.NET Framework 보안
즉시 호출자에 대한 완전 신뢰입니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분적으로 신뢰할 수 있는 코드의 라이브러리 사용을 참조하세요.