我们专注攀枝花网站设计 攀枝花网站制作 攀枝花网站建设
成都网站建设公司服务热线:400-028-6601

网站建设知识

十年网站开发经验 + 多家企业客户 + 靠谱的建站团队

量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决

vb.net读取mac,vbnet读取文件内容

怎么用vb.net获取无线网络的MAC地址

你可以使用WMI来获取MAC ID。。加上一些特定的条件也可以实现获取WLAN MAC_ID

余姚ssl适用于网站、小程序/APP、API接口等需要进行数据传输应用场景,ssl证书未来市场广阔!成为成都创新互联的ssl证书销售渠道,可以享受市场价格4-6折优惠!如果有意向欢迎电话联系或者加微信:13518219792(备注:SSL证书合作)期待与您的合作!

vb.net获取本地连接的mac地址

Private Sub Form_Load()

Dim strComputer As String

Dim objWMI As Object

Dim colIP As Object

Dim IP As Object

Dim I As Integer

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)

MsgBox "IP地址:" IP.IPAddress(I) Chr(10) _

"网卡类型:" IP.Description(I) Chr(10) _

"网卡地址:" IP.Macaddress(I)

Next

End If

Next

End Sub

用vb.net如何取得mac地址?

这是C#的,你可以转换一下

using System.Management;

//获取网卡的系列号

private static string GetMacAddress()

{

string ret = "";

try

{

ManagementClass cimobject = new ManagementClass("Win32_NetworkAdapterConfiguration");

ManagementObjectCollection moc = cimobject.GetInstances();

if (moc.Count == 0)

return "";

else

{

foreach (ManagementObject mo in moc)

{

if ((bool)mo["IPEnabled"] == true)

{

ret = (string)mo.Properties["MacAddress"].Value;

break;

}

}

}

}

catch

{

ret = "";

}

return ret;

}


网页名称:vb.net读取mac,vbnet读取文件内容
分享路径:http://shouzuofang.com/article/hdoojh.html

其他资讯