0

We have 3 lease lines for internet connectivity in our office. When there are issues with internet connectivity, the office staff has to go to RUN --> ncpa.cpl --> Right click on network --> select properties --> TCP/IPV4 --> Change default gateway value to shift between lease lines.

I would like to develop a .NET program that is able to detect at runtime the internet connectivity and change the gateway.

I donot want to use programs available on internet, rather, create my own simple application. Please provide some usefull reference for this, I have experience in .NET coding.

variable
  • 8,262
  • 9
  • 95
  • 215

1 Answers1

1

Please take a look on these websites. It might help you to some extent:

Set network configuration programmatically c#

http://social.msdn.microsoft.com/Forums/vstudio/en-US/391e01cf-4558-4375-aa1a-386ed4e3e00a/change-host-ip-address-subnet-mask-and-gateway-settings-using-c-application?forum=csharpgeneral

Community
  • 1
  • 1
Aditi
  • 509
  • 4
  • 20
  • OK, thanks, thats about changing configuration, any idea how to detect conenctivity. – variable Mar 13 '14 at 05:51
  • Just use the plain function System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable() that return true of false if the connection is up. – Aditi Mar 13 '14 at 05:55
  • I found this in following link, you can use it for further clarifications: http://stackoverflow.com/questions/2521569/how-to-detect-working-internet-connection-in-c – Aditi Mar 13 '14 at 05:55
  • One more reference: http://www.vbforums.com/showthread.php?738069-Detecting-Internet-Connections-from-Your-C-Code – Aditi Mar 13 '14 at 05:56