1

I'm developing an application (.NET, C#) for a tablet to check the various networks available, e.g. WiFi or a mobile broadband connection like 4G or 3G. The application has to execute various tests, which basically involve connecting to a specified URL and logging the amount of data sent and returned plus the time involved.

The tablet is running Windows 8 (not 8.1), I'm developing on a Windows 7 PC using Visual Studio 2013. I've already managed to "discover" the active mobile broadband and WiFi connections.

If there are multiple available connections, e.g. both a 4G mobile broadband connection and a WiFi connection, the app should do the same tests on each. However, I still haven't found how I can specify which connection to use. Is this even possible? (How does the tablet pick which one to use?)

BCdotWEB
  • 1,009
  • 1
  • 14
  • 35
  • My idea was to disable all connections except the one I wanted to test, but that seems like a lot of hassle. I've tried looking for an API, but I cannot find anything, hence this question. – BCdotWEB Aug 21 '14 at 14:08
  • possible duplicate of [Choose one of many Internet connections for an application](http://stackoverflow.com/questions/4547032/choose-one-of-many-internet-connections-for-an-application) – RealSkeptic Nov 05 '14 at 07:59

1 Answers1

1

This question Choose one of many Internet connections for an application basically answers the same problem.

You have to set the ServicePoint manually for your HttpWebRequest (which I assume you are using?). It's a bit of a hassle but totally doable. The idea behind using WebClient / HttpWebRequest is that you shouldn't have to worry about interfaces though :)

If you would like some code examples, just comment this answer with what's troubling you.

Community
  • 1
  • 1
flindeberg
  • 4,887
  • 1
  • 24
  • 37