0

Is it possible in C# which internet connection to use?

This is for check:

Ping myPing = new Ping();
String host = "google.com";
byte[] buffer = new byte[32];
int timeout = 1000;
PingOptions pingOptions = new PingOptions();
PingReply reply = myPing.Send(host, timeout, buffer, pingOptions);
if (reply.Status == IPStatus.Success) {
  // presumably online
}
Jon Skeet
  • 1,421,763
  • 867
  • 9,128
  • 9,194
  • 2
    Please read the [editing help](http://stackoverflow.com/editing-help) for details of how to format your post in future. – Jon Skeet Feb 09 '15 at 14:11
  • See http://stackoverflow.com/questions/4547032/choose-one-of-many-internet-connections-for-an-application – David P Feb 09 '15 at 14:25

0 Answers0