Posted By

jx_boi on 08/31/10


Tagged

check Uplink


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

Tyster
ovuncgursoy


Check Uplink


 / Published in: C#
 

  1. public void CheckUplink(string ip)
  2. {
  3. Ping pingSender = new Ping();
  4. PingOptions options = new PingOptions();
  5. options.DontFragment = true;
  6. string data = "test";
  7. byte[] buffer = Encoding.ASCII.GetBytes(data);
  8. //timeout before trigger
  9. int timeout = 120;
  10. PingReply reply = pingSender.Send(ip, timeout, buffer, options);
  11. if (reply.Status == IPStatus.Success)
  12. {
  13. //upon success
  14. }
  15. else
  16. {
  17. //upon failure
  18. }
  19. }

Report this snippet  

You need to login to post a comment.