Results 1 to 8 of 8

Thread: [RESOLVED] Sending ping?

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2009
    Posts
    34

    Resolved [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.

  2. #2
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    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?
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  3. #3

    Thread Starter
    Member
    Join Date
    Jan 2009
    Posts
    34

    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!");
    Last edited by Sokka93; Jan 6th, 2009 at 10:54 AM.

  4. #4
    Hyperactive Member vbcode1980's Avatar
    Join Date
    Nov 2005
    Location
    Anywhere the wind blows
    Posts
    365

    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.
    I code C#....

  5. #5

    Thread Starter
    Member
    Join Date
    Jan 2009
    Posts
    34

    Re: Sending ping?

    Thank you.

  6. #6
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: Sending ping?

    So your problem is solved now?
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  7. #7

    Thread Starter
    Member
    Join Date
    Jan 2009
    Posts
    34

    Re: Sending ping?

    Yes,Thank you.

  8. #8
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    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?
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width