如何确定哪个网络适配器连接到互联网 [英] How to determine which network adapter is connected to the internet

查看:102
本文介绍了如何确定哪个网络适配器连接到互联网的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在写一个程序在C#中,需要监控当前正在使用的网络带宽量,因此可以做一个后台上传时,互联网使用率较低。我如何可以自动确定哪个网络适配器是一个连接到互联网?

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 can I automatically determine which network adapter is the one connected to the internet?

推荐答案

我结束了下面的链接,MSDN,当我读<一href="http://stackoverflow.com/questions/849375/determine-network-interface-bandwidth-type-without-transferring-data">this页面在那里我找到了 GetBestInterface 功能。我可以用它来寻找连接到Internet的适配器,多数民众赞成

I ended up following a link to MSDN when I was reading this page where I found the GetBestInterface function. I was able to use that to find the adapter thats connected to the internet

这篇关于如何确定哪个网络适配器连接到互联网的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆