Export (0) Print
Expand All

ManagementClass.Methods Property

Gets or sets a collection of MethodData objects that represent the methods defined in the WMI class.

Namespace: System.Management
Assembly: System.Management (in system.management.dll)

public MethodDataCollection Methods { get; }
/** @property */
public MethodDataCollection get_Methods ()

public function get Methods () : MethodDataCollection

Not applicable.

Property Value

A MethodDataCollection representing the methods defined in the WMI class.

.NET Framework Security

Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.

The following example shows how to initialize a ManagementClass variable with a ManagementClass constructor and then get all the methods in the WMI class passed into the constructor.

using System;
using System.Management;

public class Example
{
    public static void Main() 
    {
        ManagementClass c = 
            new ManagementClass("Win32_Process");
        foreach (MethodData m in c.Methods)
            Console.WriteLine(
                "The class contains this method: {0}", m.Name);
        return;
    }
}

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft