12 Replies - 7014 Views - Last Post: 15 June 2012 - 09:02 AM Rate Topic: -----

#1 TechnoBear  Icon User is offline

  • D.I.C Head

Reputation: 18
  • View blog
  • Posts: 222
  • Joined: 02-November 11

Get IP Addresses of local computers who has program installed

Posted 14 June 2012 - 01:42 PM

Ok, so i have a way to get all IP addresses on the local network, however I just want to get a list of computers on the local network who also have the program installed.

Code I have to find local IP addresses:

    Private Sub GetLocalIP()
        Dim strHostName As New String("")
        Dim Address As String = ""

        strHostName = Dns.GetHostName()
        Console.WriteLine("Local Machine's Host Name: " + strHostName)

        Dim ipEntry As IPHostEntry = Dns.GetHostEntry(strHostName)
        Dim addr As IPAddress() = ipEntry.AddressList

        Dim i As Integer = 0
        While i < addr.Length
            lstPeer.Items.Add(addr(i).ToString())
            i += 1
        End While
    End Sub


Is This A Good Question/Topic? 0
  • +

Replies To: Get IP Addresses of local computers who has program installed

#2 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5675
  • View blog
  • Posts: 12,192
  • Joined: 02-June 10

Re: Get IP Addresses of local computers who has program installed

Posted 14 June 2012 - 02:51 PM

Sorry... You don't get to go pursuing through other people's computers on a whim like that.

If you are looking for a program you wrote and that is running, then you can issue some network command to a PC (think of a custom 'ping' request) and see if your application responds.

What kind of mischief are you REALLY up to?

In other words: WHY would you need to do this? What LEGITIMATE reason would you have for this?
Was This Post Helpful? 0
  • +
  • -

#3 TechnoBear  Icon User is offline

  • D.I.C Head

Reputation: 18
  • View blog
  • Posts: 222
  • Joined: 02-November 11

Re: Get IP Addresses of local computers who has program installed

Posted 14 June 2012 - 04:05 PM

I am creating a messaging app. Purely for use on the local network for now. I just want a list of people with the app active. The custom ping request sounbds exactly like what i'm looking for. I don't know how to do it though and I am finished at work for the day.
Was This Post Helpful? 0
  • +
  • -

#4 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5675
  • View blog
  • Posts: 12,192
  • Joined: 02-June 10

Re: Get IP Addresses of local computers who has program installed

Posted 14 June 2012 - 04:11 PM

Well there is the missing key to the question...
Which computers have my specific application running?

See FAQ # 7. (Click the SHOW button below)


TOP most asked:
What does this error message mean?
FAQ 2: How do I debug
FAQ 3: How do I make Class1/Form1 talk to Class2/Form2


FAQ (Frequently Asked Questions - Updated May 2012
Spoiler



Was This Post Helpful? 1
  • +
  • -

#5 TechnoBear  Icon User is offline

  • D.I.C Head

Reputation: 18
  • View blog
  • Posts: 222
  • Joined: 02-November 11

Re: Get IP Addresses of local computers who has program installed

Posted 15 June 2012 - 08:18 AM

Even though both examples are written in C# and I haven't learned that to a reasonable degree (not even a minor one really) yet, however, i did manage to decipher them both. The issue is that both are dealing with broadcast messages and thus not actually related to what I'm trying to do.

What I am trying to create at this moment is a P2P chat client which can be hosted on the users machine and send messages across a local network. I know that it can be done with what i have right now as i am able to complete a message transfer. My problem is that with the code i have, when it lists users online it lists every computer connected on the network. I would just like to know the computers which have my program running.

EDIT: The concept of a P2P chatroom is a good one which i may instigate later after my original idea has been constructed.

This post has been edited by TechnoBear: 15 June 2012 - 08:19 AM

Was This Post Helpful? 0
  • +
  • -

#6 no2pencil  Icon User is online

  • Admiral Fancy Pants
  • member icon

Reputation: 5388
  • View blog
  • Posts: 27,385
  • Joined: 10-May 07

Re: Get IP Addresses of local computers who has program installed

Posted 15 June 2012 - 08:37 AM

Why does one computer need to scan the other nodes on the network looking for the app? I would think you would want to have the app bind to a port on a server, & have the client nodes connect to the that port via ephemeral ports.

That's the correct procedure of client/server communication.
Was This Post Helpful? 1
  • +
  • -

#7 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5675
  • View blog
  • Posts: 12,192
  • Joined: 02-June 10

Re: Get IP Addresses of local computers who has program installed

Posted 15 June 2012 - 08:50 AM

For C/S yes. But the OP is trying to make a P2P chat that doesn't use C/S architecture.

So he wants all the clients to customPing all the other computers to see who is running the P2P chat app.
Was This Post Helpful? 0
  • +
  • -

#8 jon.kiparsky  Icon User is online

  • Pancakes!
  • member icon


Reputation: 8001
  • View blog
  • Posts: 13,710
  • Joined: 19-March 11

Re: Get IP Addresses of local computers who has program installed

Posted 15 June 2012 - 08:52 AM

Not my area of expertise, but to me this looks like a little server on each machine. Can you just pick a port and have your program listen on it, and respond to a ping?

(Now is de time on Shprockets where Jon makes a stupid suggestion and learns why it is bad idea!)

This post has been edited by jon.kiparsky: 15 June 2012 - 08:52 AM

Was This Post Helpful? 1
  • +
  • -

#9 TechnoBear  Icon User is offline

  • D.I.C Head

Reputation: 18
  • View blog
  • Posts: 222
  • Joined: 02-November 11

Re: Get IP Addresses of local computers who has program installed

Posted 15 June 2012 - 08:53 AM

the idea is to create a local network communication device which does not require a server to operate, thus allowing application in situations where a server setup will be unavailable
Was This Post Helpful? 0
  • +
  • -

#10 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5675
  • View blog
  • Posts: 12,192
  • Joined: 02-June 10

Re: Get IP Addresses of local computers who has program installed

Posted 15 June 2012 - 08:58 AM

View Postjon.kiparsky, on 15 June 2012 - 09:52 AM, said:

Not my area of expertise, but to me this looks like a little server on each machine. Can you just pick a port and have your program listen on it, and respond to a ping?

(Now is de time on Shprockets where Jon makes a stupid suggestion and learns why it is bad idea!)


I hope its not a stupid suggestion... Its the same one I gave earlier.


View PosttlhIn`toq, on 14 June 2012 - 03:51 PM, said:

If you are looking for a program you wrote and that is running, then you can issue some network command to a PC (think of a custom 'ping' request) and see if your application responds.



At this point we seem to be going in circles. I think its time for the OP to try to make use of our suggestions and post their own code efforts and any specific rather than conceptual issues they encounter.
Was This Post Helpful? 1
  • +
  • -

#11 TechnoBear  Icon User is offline

  • D.I.C Head

Reputation: 18
  • View blog
  • Posts: 222
  • Joined: 02-November 11

Re: Get IP Addresses of local computers who has program installed

Posted 15 June 2012 - 09:00 AM

aye, i actually am with you on this one. If I have any issues this can resurface otherwise i think this thread can die now.
Was This Post Helpful? 0
  • +
  • -

#12 jon.kiparsky  Icon User is online

  • Pancakes!
  • member icon


Reputation: 8001
  • View blog
  • Posts: 13,710
  • Joined: 19-March 11

Re: Get IP Addresses of local computers who has program installed

Posted 15 June 2012 - 09:02 AM

Quote

Its the same one I gave earlier.


So it is. Cool.
Was This Post Helpful? 0
  • +
  • -

#13 no2pencil  Icon User is online

  • Admiral Fancy Pants
  • member icon

Reputation: 5388
  • View blog
  • Posts: 27,385
  • Joined: 10-May 07

Re: Get IP Addresses of local computers who has program installed

Posted 15 June 2012 - 09:02 AM

View PostTechnoBear, on 15 June 2012 - 11:53 AM, said:

the idea is to create a local network communication device which does not require a server to operate, thus allowing application in situations where a server setup will be unavailable


In a client to client setup, you have two machines negotiating communication. One passes a message, error checks, the other revives the message & error checks. I just don't understand how this would work with a 3 node network, 5 node, 10 node network.... how does one client make certain 10 nodes received it's message? It seems like overkill to me.

I realize the suggestion was not for more theory, (& I am certainly no VB.NET programmer) but why not have the first client auto negotiate for server status. If there are no server connections available, start the server session.

Also keep in mind a server is just a service, which is a bound port. Not necessarily a 1U/2U/3U (whatever) rackmount server.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1