正在阅读:.Net基础:使用WMI获得硬盘的信息.Net基础:使用WMI获得硬盘的信息

2004-02-14 09:34 出处:CSDN 作者:acewang 责任编辑:linjixiong
 

  {

   ManagementClass diskClass = new ManagementClass("Win32_LogicalDisk");

    diskClass.Get();

   Console.WriteLine("Logical Disk class has " + diskClass.Properties.Count + " properties");

   return 0;

       }

  }                                

  [vb]
  Imports System

  Imports System.Managemen
       
  // This example demonstrates getting information about a class using the ManagementClass

  Class Sample_ManagementClass

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

  Dim diskClass As New ManagementClass("Win32_LogicalDisk")

  diskClass.Get()

  Console.WriteLine(("Logical Disk class has " & diskClass.Properties.Count.ToString() & " properties"))

  Return 0

  End Function

  End Class 

察看评论详细内容 我要发表评论
作者笔名简短内容 发表时间
:

 

键盘也能翻页,试试“← →”键

关注我们

最新资讯离线随时看 聊天吐槽赢奖品