Results 1 to 14 of 14

Thread: Find All IP on same Subnet

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2008
    Posts
    20

    Find All IP on same Subnet

    my ip is 10.10.10.66
    my subnet mask is 255.255.255.0

    want to get all other computers ip address
    any suggestions?

    thanks in advance.

  2. #2
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367

    Re: Find All IP on same Subnet

    You would have to ping 10.10.10.1 - 10.10.10.255 to determine if there is a computer at that address.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Sep 2008
    Posts
    20

    Re: Find All IP on same Subnet

    Quote Originally Posted by Negative0
    You would have to ping 10.10.10.1 - 10.10.10.255 to determine if there is a computer at that address.
    Thanks for your reply.
    Then how can I call the ping function in vb?

  4. #4
    Frenzied Member MaximilianMayrhofer's Avatar
    Join Date
    Aug 2007
    Location
    IM IN YR LOOP
    Posts
    2,001

    Re: Find All IP on same Subnet

    My.Computer.Network.Ping

  5. #5
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Find All IP on same Subnet

    Hey,

    Have a look at this article here. It shows you exactly what you need to do in order to achieve what you want:

    http://blogs.msdn.com/coding4fun/arc...31/914076.aspx

    Hope this helps!!

    Gary

  6. #6
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    Re: Find All IP on same Subnet

    see my signature (IP Subnet / Range). it will get all the possible IP addresses for a given network. then just ping them all.
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Sep 2008
    Posts
    20

    Re: Find All IP on same Subnet

    Thanks all of you Negative0, MaximilianMayrhofer, gep13 and dbasnett.

    All of your suggestions let me know how to build my solution.

    Thanks!

  8. #8
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Find All IP on same Subnet

    Hello,

    Have you had a look at any of the suggestions that have been given to you?

    For instance, the link that I sent you shows you exactly how to build the solution, and dbasnett's link has a link directly to some code as well.

    Have you tried any of the solutions? Can you post what you have tried and isn't working?

    Gary

  9. #9
    Member
    Join Date
    Apr 2008
    Posts
    40

    Re: Find All IP on same Subnet

    Is there any better way to achieve this. I m using vb.net 2005 ( FREE ) . Can System.Directoryservices used to get the ip addresses of all the hosts within the network?

  10. #10
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,290

    Re: Find All IP on same Subnet

    Have a look at this article in CodeProject
    http://www.codeproject.com/KB/IP/Lis...select=2517430
    Once you have the list of computer names, use System.Net.Dns.GetHostEntry to resolve the IP address of each computer.
    Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
    - Abraham Lincoln -

  11. #11
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Find All IP on same Subnet

    Quote Originally Posted by saechira View Post
    Is there any better way to achieve this. I m using vb.net 2005 ( FREE ) . Can System.Directoryservices used to get the ip addresses of all the hosts within the network?
    Hey,

    What do you mean by "better"? What is wrong with the approach that has been suggested?

    Gary

  12. #12
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,290

    Re: Find All IP on same Subnet

    The problem with using Ping is that windows firewall blocks ICMP echo by default. So a computer can be online yet unpingable.
    Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
    - Abraham Lincoln -

  13. #13
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Find All IP on same Subnet

    Hey,

    In my experience, computers on the same subnet (i.e. computers connected to the domain that my computer is on) have always responded to a ping request, even with the firewall on, so I can't say that I have seen this behaviour.

    Gary

  14. #14
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,290

    Re: Find All IP on same Subnet

    Quote Originally Posted by gep13 View Post
    Hey,

    In my experience, computers on the same subnet (i.e. computers connected to the domain that my computer is on) have always responded to a ping request, even with the firewall on, so I can't say that I have seen this behaviour.

    Gary
    Only if a rule is set manually in the firewall to allow ICMP echo request; and it appears that your IT guys already did that when they set up new computers.
    Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
    - Abraham Lincoln -

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