本文整理匯總了C#中System.Management.MethodDataCollection.MethodDataEnumerator類的典型用法代碼示例。如果您正苦於以下問題:C# MethodDataCollection.MethodDataEnumerator類的具體用法?C# MethodDataCollection.MethodDataEnumerator怎麽用?C# MethodDataCollection.MethodDataEnumerator使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
MethodDataCollection.MethodDataEnumerator類屬於System.Management命名空間,在下文中一共展示了MethodDataCollection.MethodDataEnumerator類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Main
//引入命名空間
using System;
using System.Management;
// This sample demonstrates how to
// enumerate all methods in
// Win32_LogicalDisk class using the
// MethodDataEnumerator object.
class Sample_MethodDataEnumerator
{
public static int Main(string[] args)
{
ManagementClass diskClass =
new ManagementClass("win32_logicaldisk");
MethodDataCollection.MethodDataEnumerator diskEnumerator =
diskClass.Methods.GetEnumerator();
while(diskEnumerator.MoveNext())
{
MethodData method = diskEnumerator.Current;
Console.WriteLine("Method = " + method.Name);
}
return 0;
}
}