![](https://iknow-base.cdn.bcebos.com/lxb/notice.png)
求win7 VS2010环境下用C#获取CPU,硬盘和主板温度的代码!!!~ 20
3个回答
展开全部
Process p = new Process();
p.StartInfo.FileName="cmd.exe";
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.CreateNoWindow = true;
p.Start();
p.StandardInput.WriteLine("netsh -c interface ip dump >f:\a.txt");
//p.WaitForExit();
//p.StandardInput.WriteLine("exit");
p.StartInfo.FileName="cmd.exe";
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.CreateNoWindow = true;
p.Start();
p.StandardInput.WriteLine("netsh -c interface ip dump >f:\a.txt");
//p.WaitForExit();
//p.StandardInput.WriteLine("exit");
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询