当前位置:编程学习 > C#/ASP.NET >>

get The local Mac Address

答案: 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

上一个:get the mac Address
下一个:在VB.NET中应用SMTP和POP3 服务

CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,