Is there a way to detect the network speed and bandwidth usage in C#? Even pointers to open-source components are welcome.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Try using the System.Net.NetworkInformation classes. In particular,
System.Net.NetworkInformation.IPv4InterfaceStatisticsought to have some information along the lines of what you’re looking for.Specifically, you can check the
bytesReceivedproperty, wait a given interval, and then check thebytesReceivedproperty again to get an idea of how many bytes/second your connection is processing. To get a good number, though, you should try to download a large block of information from a given source, and check then; that way you should be ‘maxing’ the connection when you do the test, which should give more helpful numbers.