vb获取网卡mac的完整代码

vb获取网卡mac的完整代码,第1张

VB获取网卡MAC地址源代码

>

假如只是想列驱动器名,如下很简单的,网络驱动器映射后也一样能列出。

‘列出所有驱动器,不含A,B

Dim drv() As String

Dim sd As String

drv() = Split("C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z", ",")

For i = 0 To 23

sd = drv(i) & ":\"

If Dir(sd, vbDirectory) <> "" Then

combAddItem sd ’添加到列表中

End If

Next

 这段代码能获得显示器型号 不明白你说的显示器序列号是什么 刚看了设备管理器上也没这项

Private Sub Command1_Click()

Dim s, System, item

Set System = GetObject("winmgmts:")InstancesOf("Win32_DesktopMonitor")

For Each item In System

s = s & "caption:" & itemCaption & vbCrLf

s = s & "Description:" & itemDescription & vbCrLf

s = s & "ScreenWidth:" & itemScreenWidth & vbCrLf

s = s & "ScreenHeight:" & itemScreenHeight & vbCrLf

s = s & "MonitorManufacturer:" & itemMonitorManufacturer & vbCrLf

Next

Print s

End Sub

Option Explicit

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

Const MAX_FILENAME_LEN = 256

Private Sub Form_Load()

Dim RetVal As Long

Dim str As String MAX_FILENAME_LEN

Dim str2 As String MAX_FILENAME_LEN

Dim A As Long

Dim B As Long

MeShow

Call GetVolumeInformation("C:\", str, MAX_FILENAME_LEN, RetVal, A, B, str2, MAX_FILENAME_LEN)

Text1 = RetVal

End Sub

以上就是关于vb获取网卡mac的完整代码全部的内容,包括:vb获取网卡mac的完整代码、vb如何获取文件属性等信息、vb6.0中如何自动篇历系统的全部驱动器并获得全部信息等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/9813454.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-02
下一篇 2023-05-02

发表评论

登录后才能评论

评论列表(0条)

保存