新网创想网站建设,新征程启航

为企业提供网站建设、域名注册、服务器等服务

vb.net提取硬件码 vb中提取身份证的代码

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获取电脑机器码

很难达到你的要求的,VB好像是获取不到硬盘的物理序列号的,只能获取到某一个分区的序列号.不过可以调用其它的程序写的获取硬盘物理序列号的dll来获取,CPU的序列号我用的是wmi.VB本来对底层方面就不是很好

引用api获得硬盘序列号

Private Declare Function MymachineC Lib "kernel32" Alias "GetVolumeInformationA" (ByVal lpRootPathName As String, ByVal lpVolumeNameBuffer As String, ByVal nVolumeNameSize As Long, lpVolumeSerialNumber As Long, lpMaximumComponentLength As Long, lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As String, ByVal nFileSystemNameSize As Long) As Long

Private Sub Form_Load()

Dim AA, 硬盘序列号, Maxlen, Sysflag As Long: Dim VolName, FsysName As String

AA = MymachineC("c:\", VolName, 256, 硬盘序列号, Maxlen, Sysflag, FsysName, 256)

msgbox "C硬盘序列号-机器码啦-(16制): " Hex(硬盘序列号)

End Sub

求人!!!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

主板驱动信息:

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提取硬件码 vb中提取身份证的代码
URL标题:http://wjwzjz.com/article/dojoshj.html
在线咨询
服务热线
服务热线:028-86922220
TOP