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