3C科技 娛樂遊戲 美食旅遊 時尚美妝 親子育兒 生活休閒 金融理財 健康運動 寰宇綜合

Zi 字媒體

2017-07-25T20:27:27+00:00
加入好友
C# 取得網卡的 MAC Address [GOOGLE: 抓 網卡 C#] 資料來源:https://dotblogs.com.tw/city7/2013/07/02/107624 完整程式碼備份(github):https://github.com/jash-git/CS_Get_netMac   //引用函式庫 using System.Net.NetworkInformation; //抓取網卡 NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces(); List macList = new List(); foreach (var nic in nics) {     // 因為電腦中可能有很多的網卡(包含虛擬的網卡),     // 我只需要 Ethernet 網卡的 MAC     if (nic.NetworkInterfaceType == NetworkInterfaceType.Ethernet)     {         macList.Add(nic.GetPhysicalAddress().ToString());     } }        

本文由jashliaoeuwordpress提供 原文連結

寫了 5860316篇文章,獲得 23313次喜歡
精彩推薦