星期四, 九月 14, 2006

(VB.NET)获取本地硬盘的信息

Imports System

Imports System.Management

 

Module Module1

    Public Sub Main()

        Dim disk As ManagementObject = New ManagementObject( "win32_logicaldisk.deviceid=""c:""")

        disk.Get()

        Console.WriteLine("Logical disk size is " + disk("Size" ).ToString + " bytes")

    End Sub

End Module

 
 

驱动器类型disk("DriveType")

Value=2

Value=3

Value=4

Value= 5

Value= 6

Floppy disk

Hard disk

network drive

CDROM

RAM Disk

 


没有评论: