-2

How to get current value of wlan transfer speed(PC-Router)? I am trying to search this parametr in wlanapi library, but I couldn't.

I want "wireless network connection speed". I guess it is the same as "theoretical bits per second"

Jerome
  • 35
  • 6
  • Find a function that provides statistics (total bytes sent/received) and call it every second. – Andrey Nasonov Sep 27 '15 at 14:06
  • 1
    Do you want "bytes per second actually transferred" or the "theoretical bits per second"? The two can be very different, and the approach to "get" either is definitely not the same. – Mats Petersson Sep 27 '15 at 14:13
  • I want "wireless network connection speed". I guess it is the same as "theoretical bits per second" – Jerome Sep 27 '15 at 14:54

1 Answers1

0

I want "wireless network connection speed". I guess it is the same as "theoretical bits per second"

You can get it like this:

var speed = NetworkInterface.GetAllNetworkInterfaces()
            .Where(inf => inf.NetworkInterfaceType == NetworkInterfaceType.Wireless80211)
            .Where(inf => inf.OperationalStatus == OperationalStatus.Up)
            .Select(inf => inf.Speed)
            .First();
Eser
  • 12,346
  • 1
  • 22
  • 32