using System.Management;
private void button1_Click(object sender, EventArgs e)
{
ManagementClass mc = new ManagementClass("Win32_NetworkAdapterConfiguration");
ManagementObjectCollection moc = mc.GetInstances();
string info = "";
foreach(ManagementObject mo in moc)
{
info += string.Format("ipenabled:{0} mac:[{1}] /r/n", mo["IPEnabled"], mo["MacAddress"]);
}
textBox1.Text = info;
}