成都创新互联网站制作重庆分公司

vb.net读取网卡地址 vb获取网卡物理地址

vb.net笔记本读不出网卡地址

出现这样的原因,大部分是由于 无线网卡没有安装到位,接触不良造成的。

创新互联建站主要从事成都网站设计、网站建设、外贸网站建设、网页设计、企业做网站、公司建网站等业务。立足成都服务北镇,十余年网站建设经验,价格优惠、服务专业,欢迎来电咨询建站服务:028-86922220

网卡可以多插几次。如果这样,问题没有解决,带着您的笔记本找网卡服务商,如果他们解决不了,

那问题可能就在于笔记本本身。带着您的本本和卡找您的本本服务商。

电脑有两张网卡。如何用vb.net分别获取网卡的IP?求大神明路!

'要使得引用System.Management有效,先通过菜单

'[项目]--[添加引用],在“.Net”选项卡里,选择“System.Management”,单击[确定]

Imports System.Management

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim MySearcher As New ManagementObjectSearcher("SELECT * FROM Win32_NetworkAdapterConfiguration")

For Each MySearcherObj As ManagementObject In MySearcher.Get

If CBool(MySearcherObj("IPEnabled")) Then

MsgBox(MySearcherObj("IPAddress")(0))

End If

Next

End Sub

End Class

vb.net 如何获取指定IP的网卡地址MAC

Public Function EnumNetworkAdapters() As String

Try

Dim query As System.Management.ManagementObjectSearcher = New System.Management.ManagementObjectSearcher("SELECT * FROM Win32_NetworkAdapterConfiguration")

Dim queryCollection As System.Management.ManagementObjectCollection = query.Get()

Dim mo As New System.Management.ManagementObject

For Each mo In queryCollection

If IsDBNull(mo.Item("Description")) = False Then

EnumNetworkAdapters = mo.Item("Description") "|||"

End If

If IsDBNull(mo.Item("macaddress")) = False Then

If mo.Item("macaddress") "" Then

EnumNetworkAdapters = mo.Item("macaddress") "|||"

End If

End If

If IsDBNull(mo.Item("IPAddress")) = False Then

Dim temp As String

temp = Join(mo.Item("IPAddress"), ".")

If temp "" Then

EnumNetworkAdapters = temp "|||"

End If

End If

Next

Catch err AS Exception

EnumNetworkAdapters = err.Message err.StackTrace

End Try

End Function


当前名称:vb.net读取网卡地址 vb获取网卡物理地址
文章源于:http://cxhlcq.com/article/docsipp.html

其他资讯

在线咨询

微信咨询

电话咨询

028-86922220(工作日)

18980820575(7×24)

提交需求

返回顶部