How to determine which network adapter is connected to the internet

后端 未结 6 950
死守一世寂寞
死守一世寂寞 2020-12-20 20:23

I\'m writing a program in C# that needs to monitor the amount of internet bandwidth currently in use so it can do a background upload when the internet usage is low. How ca

6条回答
  •  春和景丽
    2020-12-20 20:40

    You can use WMI to query all the adapters and see which one is connected.
    This article shows you how to do it in VB.Net (very easily transferable to C#).

提交回复
热议问题