Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I tell if the connection is metered?

I wrote a program that monitors an IMAP email account. It runs on a schedule, on a laptop that I travel with. Sometimes it runs when my internet connection is through my mobile device, which has a metered connection (that is, I pay by the GB), and I don't want it to, because it uses a lot of bandwidth, and it can wait until bandwidth is free.

So the question is: how can a .NET program determine when the connection its using is metered?

like image 469
Joshua Frank Avatar asked Apr 20 '13 16:04

Joshua Frank


1 Answers

A brief search of MSDN found the NetworkInformation.GetInternetConnectionProfile function. It looks like it's officially part of the Metro interface, but I have heard that desktop applications can access most of the Metro libraries.

like image 92
Andrew Avatar answered Oct 25 '22 10:10

Andrew