vb.net硬件信息 vbnet using

vb获取硬件信息的代码tmpstr=""
set fso=createObject("scripting.filesystemObject")
Set dc = fso.Drives
for each d in dc
If d.isReady Then
tmpstr=tmpstr"磁盘"d.DriveLetter":"vbcrlf _
"可用空间:"(d.AvailableSpace/1024/1024/1024)" GB"vbcrlf _
"空余空间:"(d.FreeSpace/1024/1024/1024)" GB"vbcrlf _
"总空间大?。?(d.TotalSize/1024/1024/1024)" GB"vbcrlf _
"文件系统:"d.FileSystemvbcrlf _
"驱动器类型:"d.DriveType vbcrlf _
"是否就绪:"d.IsReady vbcrlf _
"路径:"d.Path vbcrlf _
"根目录:"d.RootFolder vbcrlf _
"序列号:"d.SerialNumber vbcrlf _
"共享名:"d.ShareName vbcrlf _
"卷名:"d.VolumeName vbcrlf vbcrlf
End If
Next
msgbox tmpstr
VB.Net如何查看计算机硬件的详细属性(如:查看U盘的位置)?先引用system.io
之后声明类型为 DriveInfo vb.net硬件信息的变量
声明vb.net硬件信息的对象中包含 一些方法
求人?。。B.net 获取硬件信息?。。?/h2>显卡vb.net硬件信息:
Private Sub get_disp_info()
Dim i As Integer
Dim info(50) As String
Dim name(50) As String
Dim j As Integer
name(0) = "Name"
name(1) = "Caption"
name(2) = "ColorPlanes"
name(3) = "Description"
name(4) = "RefreshRate"
name(5) = "SettingID"
name(6) = "VideoMode"
name(7) = "VerticalResolution"
name(8) = "SystemPaletteEntries"
name(9) = "ReservedSystemPaletteEntries"
name(10) = "BitsPerPixel"
name(11) = "DeviceEntriesInAColorTable"
name(12) = "DeviceSpecificPens"
name(13) = "HorizontalResolution"
Dim opt As New System.Management.ManagementObjectSearcher("Select * from Win32_DisplayControllerConfiguration")
For Each obj2 As System.Management.ManagementObject In opt.Get
For j = 0 To 13
Try
info(j) = obj2(name(j))
Catch ex As Exception
info(j) = ""
End Try
Next
For i = 0 To 14
Dim newitem1 As New ListViewItem(name(i))
newitem1.SubItems.Add(info(i))
List_disp.Items.Add(newitem1)
Next
Next
End Sub
主板驱动信息vb.net硬件信息:
Private Sub get_bois_info()
Dim i As Integer
Dim info(50) As String
Dim name(50) As String
Dim j As Integer
name(0) = "Name"
name(1) = "Caption"
name(2) = "SerialNumber"
name(3) = "Manufacturer"
name(4) = "Description"
name(5) = "PrimaryBIOS"
name(6) = "Version"
name(7) = "Status"
name(8) = "BuildNumber"
name(9) = "CodeSet"
【vb.net硬件信息 vbnet using】name(10) = "CurrentLanguage"
name(11) = "IdentificationCode"
name(12) = "InstallableLanguages"
name(13) = "InstallDate"
name(14) = "LanguageEdition"
name(15) = "OtherTargetOS"
name(16) = "ReleaseDate"
name(17) = "SMBIOSBIOSVersion"
name(18) = "SMBIOSMajorVersion"
name(19) = "SMBIOSMinorVersion"
name(20) = "SMBIOSPresent"
name(21) = "SoftwareElementID"
name(22) = "SoftwareElementState"
name(23) = "TargetOperatingSystem"
name(24) = "ListOfLanguages"
name(25) = "BIOSVersion"
name(26) = "BiosCharacteristics"
Dim k As Integer
Dim opt As New System.Management.ManagementObjectSearcher("Select * from Win32_BIOS")
For Each obj2 As System.Management.ManagementObject In opt.Get
For j = 0 To 23
Try
info(j) = obj2(name(j))
Catch ex As Exception
info(j) = ""
End Try
Next
Try
info(24) = ""
For k = 0 To obj2(name(24)).length - 1
info(24) += obj2(name(24))(k)
Next
Catch ex As Exception
info(24) = ""
End Try
Try
info(25) = ""
For k = 0 To obj2(name(25)).length - 1
info(25) += obj2(name(25))(k)
Next
Catch ex As Exception

推荐阅读