question

lyXu-2652 avatar image
0 Votes"
lyXu-2652 asked ·

When using C# WiFiAdapter to get information, always get the "too many session" error message......

 for(int i=1; i<=30; i++)
             {
                 Console.WriteLine(i);
                 var access = await WiFiAdapter.RequestAccessAsync();
                 if (access == WiFiAccessStatus.Allowed)
                 {
                     var result = await Windows.Devices.Enumeration.DeviceInformation.FindAllAsync(WiFiAdapter.GetDeviceSelector());
                     if (result.Count >= 1)
                     {
                         fiAdapter = await WiFiAdapter.FromIdAsync(result[0].Id);
                         await fiAdapter.ScanAsync();
                         foreach (var item in fiAdapter.NetworkReport.AvailableNetworks)
                         {
                             if (item.Ssid == ssid)
                             {
                                 double rssi = item.NetworkRssiInDecibelMilliwatts;
                                 Console.WriteLine(rssi);
                             }
                         }
                     }
                 }
             }

After 19 loops, return "......too many sessions......" error message, someone help?

not-supported
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

0 Answers