Click here to Skip to main content
Click here to Skip to main content

A C# Ping Control

By , 9 Feb 2007
 

Sample image

Introduction

This control (with such an original name as DBnetPing 1.1!) has been designed to wrap the functionality of building an ICMP ping packet, sending it, and timing the response to give you an accurate ping time in milliseconds.

Usage

Simply drop the control onto your form and call the function:

results = dBnetPing1.pingHost(txtHost.Text);

results is a simple class that lets you call GetResponseTimeMS which returns an int containing (yep - you guessed it) the response time in milliseconds:

MessageBox.Show("Ping successfull! " + results.GetResponseTimeMS().ToString() + 
    " ms", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);

Credits

I created this function/wrapper heavily based on already existing C# code; unfortunately, I do not remember the author. If anyone can help me here, I'd be glad to add. Kudos.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

daniel.byrne
Europe Europe
Member
No Biography provided

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
GeneralNo Source codememberDanilo Corallo8 Nov '07 - 4:50 
Where's the component source? D'Oh! | :doh:
Generalusage in VC++ 6.0member12kaunas1 Mar '07 - 9:58 
Can I use this control in VC++ 6.0 application.
 
thanks,
Alex

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web04 | 2.6.130516.1 | Last Updated 9 Feb 2007
Article Copyright 2007 by daniel.byrne
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid