惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
G
Google Developers Blog
小众软件
小众软件
V
V2EX
月光博客
月光博客
腾讯CDC
aimingoo的专栏
aimingoo的专栏
J
Java Code Geeks
Y
Y Combinator Blog
人人都是产品经理
人人都是产品经理
B
Blog RSS Feed
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - 【当耐特】
D
Docker
M
MIT News - Artificial intelligence
Google DeepMind News
Google DeepMind News
N
Netflix TechBlog - Medium
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
I
InfoQ
MongoDB | Blog
MongoDB | Blog
Apple Machine Learning Research
Apple Machine Learning Research
Jina AI
Jina AI

博客园 - walker

[转]有一种爱叫索取 悟空,真的是空? Interpreter解释器(行为型模式) Command命令(行为型模式) TemplateMethod模板方法(行为型模式) Proxy代理(结构型模式) Flyweight享元(结构型模式) Facade外观(结构型模式) Decorator装饰(结构型模式) Composite组合(结构型模式) Singleton单件(创建型模式) Bridge桥接(结构型模式) Adapter适配器(结构型模式) Prototype原型(创建型模式) Builder生成器(创建型模式) AbstractFactory抽象工厂(创建型模式) FactoryMethod工厂方法(创建型模式) 一个C#睡前故事 C#怎样打开关闭CDROM?
C#中得到网卡号
walker · 2006-02-21 · via 博客园 - walker

using System.Management;

//get the MAC address

ManagementClass mc=new ManagementClass("Win32_NetworkAdapterConfiguration");

ManagementObjectCollection moc=mc.GetInstances();

string[] MacAddress=new string[2];

int ii=0;

foreach(ManagementObject mo in moc)

{

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

 {

 MacAddress[ii]=mo["MacAddress"].ToString();

 ii++;

 }

mo.Dispose();

}