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();
string temp = s.Substring(s.IndexOf("Physical Address. . . . . . . . . :") + 36, 17);
//MessageBox.Show(s.Substring(s.IndexOf("Physical Address. . . . . . . . . :") + 36, 17));
Label1.Text = temp;
获取MAC地址。。。。。。。。。
最新推荐文章于 2022-05-25 12:04:59 发布