Есть ли способ получить и отобразить текущий уровень беспроводного сигнала устройства приложения на C #? У меня есть приложение, которое определяет, есть ли соединение с помощью таймера, однако мне нужно знать текущий уровень сигнала, а затем отображать его графически в строке состояния. Ниже приведен мой текущий код для обнаружения базового подключения каждые несколько секунд. Что я могу добавить, чтобы показать силу? Спасибо. Код таймера был предоставлен С.О. пользователь: parapura rajkumar
private void Form1_Load(object sender, EventArgs e)
{
//create an object to hold app settings FIRST
appsetting apps = new appsetting();
apps.getsetting();
netMessage.Clear();
//creates a timer for refresh rate on connectivity check
var timer = new Timer();
timer.Tick += new EventHandler(timer_Tick);
timer.Interval = 2000; //2 seconds
timer.Start();
}
//starts the timer
void timer_Tick(object sender, EventArgs e)
{
//if connection is not detected
if (System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable() ==f
false)
{
//clear the buffer
netMessage.Clear();
//turn RED indicator on and display message
netConnect.BackColor = Color.Red;
this.netMessage.Text = ("No Connection");
noConn = true;//set "No connection" to true
conn= false;
}
else
//turn GREEN indicator on and display message
netConnect.BackColor = Color.Lime;
this.netMessage.Text = ("Connected");
conn = true;// set connection to "true
noConn = false;
//if box is red but connection is established, turn it back to green
if (noConn == true &&
System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable() ==
true)
{
netConnect.BackColor = Color.Lime;
this.netMessage.Text = ("Connected");
conn = true;
noConn = false;
}
}
//need to display signal strength in a text box with color codes or status bar HERE