System.Diagnostics.Process p=new System.Diagnostics.Process();
p.StartInfo.CreateNoWindow=true;
p.StartInfo.UseShellExecute=false;
p.StartInfo.RedirectStandardOutput=true;
p.StartInfo.FileName="ipconfig";
p.StartInfo.Arguments="/all";
p.Start();
p.WaitForExit();
string s=p.StandardOutput.ReadToEnd();
MessageBox.Show(s.Substring(s.IndexOf("Physical Address. . . . . . . . . :")+36,17));
2。使用API,利用ARP协议,只能获得同网段计算机的MAC
#region By ARP