我试图在C#中创建一个显示wifi信号强度的应用程序 我可以获得信号强度,但我想我的应用程序将每秒检查信号强度! 我使用backgroundworker,但它不起作用。 我获得信号强度的方法:
Process proc = new Process
{
StartInfo = new ProcessStartInfo
{
FileName = "netsh.exe",
Arguments = "wlan show interfaces",
UseShellExecute = false,
RedirectStandardOutput = true,
CreateNoWindow = true
}
};
proc.Start();
string line;
while (!proc.StandardOutput.EndOfStream)
{
line = proc.StandardOutput.ReadLine();
if (line.Contains("Signal"))
{
label1.Text = line.Split(':')[1];
}
}