zoukankan      html  css  js  c++  java
  • 利用VisualBasic获取计算机硬件指纹的范例代码

    MsgValue = ""
    Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
    '获取硬盘序列号
    Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_PhysicalMedia", , 48)
    For Each objItem In colItems
    MsgValue = MsgValue & vbCrLf & "硬盘 = " & objItem.SerialNumber
    Next
    '获取主板序列号
    Set colItems = objWMIService.ExecQuery("Select * from Win32_BaseBoard", , 48)
    For Each objItem In colItems
    MsgValue = MsgValue & vbCrLf & "主板 = " & objItem.SerialNumber
    Next
    '获取CPU ID
    Set colItems = objWMIService.ExecQuery("Select * from Win32_Processor", , 48)
    For Each objItem In colItems
    MsgValue = MsgValue & vbCrLf & "CPU = " & objItem.ProcessorId
    Next
    '获取BIOS序列号
    Set colItems = objWMIService.ExecQuery("Select * from Win32_BIOS", , 48)
    For Each objItem In colItems
    MsgValue = MsgValue & vbCrLf & "BIOS = " & objItem.SerialNumber
    Next
    '获取网卡MAC地址
    Set colItems = objWMIService.ExecQuery("SELECT MACAddress FROM Win32_NetworkAdapter WHERE ((MACAddress Is Not NULL) AND (Manufacturer <> 'Microsoft'))", , 48)
    For Each objItem In colItems
    MsgValue = MsgValue & vbCrLf & "网卡 = " & objItem.MACAddress
    Next
    Wscript.Echo MsgValue

  • 相关阅读:
    四、K8S
    三、kubernetes环境搭建(实践)
    二、K8S镜像问题
    一、linux扩展
    十、docker扩展
    二、kubernetes环境搭建
    一、Composer
    一、权限控制-过滤器
    二、kubernetes
    【2019-06-28】客观认知
  • 原文地址:https://www.cnblogs.com/ericsun/p/2882909.html
Copyright © 2011-2022 走看看