vb点虐 获取硬件信息 vbnet recordset
求人!!!VB点虐 获取硬件信息!!!
显卡:
创新互联公司-专业网站定制、快速模板网站建设、高性价比谢通门网站开发、企业建站全套包干低至880元,成熟完善的模板库,直接使用。一站式谢通门网站制作公司更省心,省钱,快速模板网站建设找我们,业务覆盖谢通门地区。费用合理售后完善,10年实体公司更值得信赖。
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
主板驱动信息:
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"
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
info(25) = ""
End Try
Try
info(26) = ""
For k = 0 To obj2(name(26)).length - 1
info(26) += obj2(name(26))(k)
Next
Catch ex As Exception
info(26) = ""
End Try
For i = 0 To 27
Dim newitem1 As New ListViewItem(name(i))
newitem1.SubItems.Add(info(i))
List_bois.Items.Add(newitem1)
Next
Next
End Sub
VB.NET 获取网关IP MAC地址
我找了一些C# 的VB。NET 貌似很少不过都是。NET 平台。你看看吧都应该通用的。
添加对System.Management的引用
using System.Management;
。。。
//获取IP,子网掩码(subnet mask)和默认网关
ManagementClass mc = new ManagementClass( "Win32_NetworkAdapterConfiguration ");
ManagementObjectCollection nics = mc.GetInstances();
foreach(ManagementObject nic in nics)
{
if(Convert.ToBoolean(nic[ "ipEnabled "]) == true)
{
Console.WriteLine((nic[ "IPAddress "] as String[])[0]);
Console.WriteLine((nic[ "IPSubnet "] as String[])[0]);
Console.WriteLine((nic[ "DefaultIPGateway "] as String[])[0]);
}
}
获取硬件信息源代码:
获取硬件信息演示程序:
汉化
利用using System.Management类来获取相应的硬件知识
其实这类东西很容易找到答案的,方法非常多,最常见的API模式,你去搜索吧,保证一把一把的
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.FileSystem vbcrlf _
"驱动器类型:" 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点虐 获取硬件信息 vbnet recordset
本文网址:http://myzitong.com/article/ddseope.html