how to ping with ip address in c#

Опубликовано: 05 Август 2026
на канале: IT Core Soft
863
6

Download from this link: https://github.com/hamza3344/ping
My fiverr link: https://www.fiverr.com/hamzakhalid178
My Upwork Profile: https://www.upwork.com/freelancers/~0...

Whatsapp Number: +923338672398


if you have any problem comment below. please like, share and subscribe the channel. Contact me on [email protected] if you need any custom software, website and mobile Application.

code

using System.Net.NetworkInformation;

in button load

using(Ping p=new Ping())
{
PingReply r;
string s;
s = textBox1.Text;
r = p.Send(s);
if(r.Status==IPStatus.Success)
{
label1.Text = "Ping to" + s.ToString() + "[" + r.Address.ToString() + "] suceessful repsonse delay=" + r.RoundtripTime.ToString() + "ms";

}
else
{
label1.Text = "not connected";
}
}