-
[RESOLVED] Sending ping?
I'm making a roll call program with C# and I want to use my program on a computer that will sends pings every computers' IP address that that I want. I can send ping some computers but others don't work. I can't send ping every computers. Could you please help me with it?
Thank in advance.
-
Re: Sending ping?
Welcome to VBForums.
So you're saying you can ping certain computers but not all? Could you show us how you are pinging them?
-
Re: Sending ping?
Here you are
Code:
string address;
address = textBox1.Text;
Ping p = new Ping();
PingReply reply = p.Send(address);
if (reply.Status == IPStatus.Success)
{
textBox2.Text = System.Net.Dns.GetHostByAddress(address).HostName.ToString();
MessageBox.Show("");
}
else
MessageBox.Show("Nooooooooo!");
-
Re: Sending ping?
Your code seems to work fine, apart from the second line. You're using a variable 'adres' while you've declared 'address'.
There are a lot of reasons why a ping request isn't answered.
It could be send to a router that blocks ping requests.
Firewalls (either hardware or software) can also block ping requests.
-
Re: Sending ping?
-
Re: Sending ping?
So your problem is solved now?
-
Re: Sending ping?
-
Re: Sending ping?
Then could you please mark you thread resolved by using the Thread Tools menu that you can find at the top of the thread? :)