• 专业师傅

  • 全国服务

  • 质量保障

欢迎进入啄木鸟问答频道,这里提供最专业的问答知识
搜索答案
我要提问

vb怎么读取硬盘序列号丶总容量

4155人浏览 2023-09-18
我来答
    取消
    提交回答
3个回答
  • 648036523
    648036523

    2023-09-18

    最优回答

      获取网卡信息 IP 网卡名称 网卡MAC地址  Private Sub Form_Load()  Teip.Text =   Dim mac  strComputer = .  mac =   '获得MAC信息  Set objWMIService = GetObject(winmgmts: & {impersonationLevel=impersonate}!// & strComputer & /root/cimv2) '''加上这个  Set colItems = objWMIService.ExecQuery(Select * from Win32_NetworkAdapterConfiguration Where IPEnabled=TRUE)  For Each objItem In colItems  mac = mac + + objItem.macaddress  Next  TeMac.Text = Replace(Trim(mac), :, -)  strComputer = .  Set objWMI = GetObject(winmgmts:// & strComputer & /root/cimv2)  Set colIP = objWMI.ExecQuery(Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE)  For Each IP In colIP  If Not IsNull(IP.ipaddress) Then  For i = LBound(IP.ipaddress) To UBound(IP.ipaddress)  'Mac = Ip.macaddress(I)objObject.DNSHostName  If IP.ipaddress(i) = 0.0.0.0 Then  Else  Teip.Text = Trim(Teip.Text + + IP.ipaddress(i))  End If  'MsgBox IP 地址: & IP.ipaddress(i) & Chr(10) & _  网卡类型: & IP.Description(i) & Chr(10) & _  网卡地址: & IP.macaddress(i)  Text3.Text = IP.Description(i)  Next  End If  Next  End Sub  获取CPUID  Public Sub getCpuId()  Dim strComputer As String  Dim objWMIService, colDevices, objDevice  strComputer = .  On Error Resume Next  Set objWMIService = GetObject(winmgmts:\\ & strComputer)  Set colDevices = objWMIService.ExecQuery _  (Select * From Win32_Processor)  For Each objDevice In colDevices  CPUID = objDevice.ProcessorID  Next  End Sub  网卡和硬盘都容易坏的 经常换  建议用CPUid

    0
  • l460727228
    l460727228

    2023-09-18

    VB什么版本?

    回答:

    0
  • wml84832655
    wml84832655

    2023-09-18

    Private Declare Function GetLogicalDriveStrings Lib kernel32 Alias _ GetLogicalDriveStringsA (ByVal nBufferLength As Long, _ ByVal lpBuffer As String) As Long取得当前所有盘符Private Declare Function GetDriveType Lib kernel32 Alias GetDriveTypeA _ (ByVal nDrive As String) As Long判断盘符类型 Private Declare Function GetDiskFreeSpace Lib kernel32 Alias GetDiskFreeSpaceA (ByVal lpRootPathName As String, lpSectorsPerCluster As Long, lpBytesPerSector As Long, lpNumberOfFreeClusters As Long, lpTtoalNumberOfClusters As Long) As Long这个或者下面函数取得磁盘信息Private Declare Function GetDiskFreeSpaceEx Lib kernel32.dll Alias GetDiskFreeSpaceExA (ByVal lpDirectoryName As String, ByRef lpFreeBytesAvailableToCaller As ULARGE_INTEGER, ByRef lpTotalNumberOfBytes As ULARGE_INTEGER, ByRef lpTotalNumberOfFreeBytes As ULARGE_INTEGER) As Long

    回答:

    0
推荐维修服务:若未解决您的问题,请您直接联系客服或拨打电话: 为你解忧
正规家庭维修哪家好?

·找啄木鸟家庭维修

·人才库累计注册数十万维修工程师

·信息严格加密,放心预约

·预约只需6秒快速完成!

请选择分类
      获取验证码
      维修服务推荐
      特别推荐

      友链交换:
      手机维修