我一直在尝试想出一种使用 C# 查询 WiFi 信息的理想方法。我已经尝试过该netsh
方法,但不确定如何分离信息。我注意到Vistumbler
使用netsh
. 有没有办法让这些开发人员在查询时分离信息,netsh
或者他们只是执行了大量的字符串操作来删除不相关的东西。
问问题
6181 次
1 回答
6
这就是我通常所做的。调用netsh
,获取输出并解析它。
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
于 2011-11-25T22:22:14.743 回答