Get Signal Strength from windows CE device using OpenNETCF / C#

34 Views Asked by At

I'm already serach the whole internet abut this probelm but with no good result.

I need get signal strength in c# using OpenNETCF.

I tried with this code:

            string x = "";
            var adapters = OpenNETCF.Net.NetworkInformation.WirelessNetworkInterface.GetAllNetworkInterfaces();
            foreach (WirelessNetworkInterface adapter in adapters)
                x = adapter.SignalStrength.Decibels.ToString();
            label1.Text = x;

Visual Studio don't throw any error, but when i run the device show me:„Invalid Cast Exception” :/

Edit

Stacktrace:

MYapp OpenNETCF.exe InvalidCastException at
MYapp_OpenNETCF.Form1.button1_Click(Object sender, EventArgs e) at
System.Windows.Forms.Control.OnClick(EventArgs e) at
System.Windows.Forms.Button.OnClick(EventArgs e) at
System.Windows.Forms.ButtonBase.WnProc(WM wm, Int32 wParam, Int32 lParam) at
System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam) at
Microsoft.AGL.Forms.EVL.EnterMainLoop(IntPtr hwnMain) at System.Windows.Forms.Application.Run(Form fm) at
MYapp_OpenNETCF.Program.Main()
0

There are 0 best solutions below