querying netsh in c#

落花浮王杯 提交于 2019-12-04 19:47:36
GETah

That is what I do usually. Call netsh, get the output and parse it.

Process p = new Process();
p.StartInfo.FileName = "netsh.exe";
p.StartInfo.Arguments = "netsh arguments...";
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.Start();

string output = p.StandardOutput.ReadToEnd();
// parse output and look for results
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!