一聚教程网:一个值得你收藏的教程网站

热门教程

get The local Mac Address

时间:2022-07-02 12:02:46 编辑:袖梨 来源:一聚教程网

 Dim mc As ManagementClass
        Dim moc As ManagementObjectCollection
        Dim mo As ManagementObject
        mc = New ManagementClass("Win32_NetworkAdapterConfiguration")
        moc = mc.GetInstances() ' Get all network adapter instances
        For Each mo In moc
       If mo.Item("IPEnabled") = True Then
           TextBox1.Text = mo.Item("MacAddress").ToString()
       End If
       mo.Dispose()
        Next

热门栏目