真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

vb.net讀取mac vbs文件讀寫(xiě)

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

這是C#的,你可以轉(zhuǎn)換一下

創(chuàng)新互聯(lián)是一家專(zhuān)業(yè)提供清河企業(yè)網(wǎng)站建設(shè),專(zhuān)注與成都網(wǎng)站建設(shè)、網(wǎng)站設(shè)計(jì)、HTML5建站、小程序制作等業(yè)務(wù)。10年已為清河眾多企業(yè)、政府機(jī)構(gòu)等服務(wù)。創(chuàng)新互聯(lián)專(zhuān)業(yè)網(wǎng)站設(shè)計(jì)公司優(yōu)惠進(jìn)行中。

using System.Management;

//獲取網(wǎng)卡的系列號(hào)

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獲取無(wú)線(xiàn)網(wǎng)絡(luò)的MAC地址

你可以使用WMI來(lái)獲取MAC ID。。加上一些特定的條件也可以實(shí)現(xiàn)獲取WLAN MAC_ID

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) _

"網(wǎng)卡類(lèi)型:" IP.Description(I) Chr(10) _

"網(wǎng)卡地址:" IP.Macaddress(I)

Next

End If

Next

End Sub


文章題目:vb.net讀取mac vbs文件讀寫(xiě)
文章轉(zhuǎn)載:http://weahome.cn/article/hepojo.html

其他資訊

在線(xiàn)咨詢(xún)

微信咨詢(xún)

電話(huà)咨詢(xún)

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部