views:

75

answers:

2

So after hours of research i have found nothing about this question.

Is it possible to see who is connected to my wireless network using C#?

Example: I have 2 Laptops - Laptop A and Laptop B.

  • A is on running my program I made and connected to my wireless network.

  • B is starting up and connects to my wireless network. A can now see that B is connected to the wireless network through the program I made.

Is this possible?

+2  A: 

Is it possible to see whos connected to my wireless network using C#?

Option 1) depends on what your wireless connection device is (supposing a router or access point) and how programmable it is. For instance, if you have a Linksys WRT54GL, you could load DD-WRT or another OSS firmware and write your own modules to monitor this behavior. Programming that module in C# would require loading the mono libraries into the DD-WRT install.

Option 2) install a "heartbeat monitor" on each machine that could connect to the wireless network. Once the connection to that gateway has been made, the daemon tells other monitors that it is now connected to the network.

Option 1 is best if you have no control over what devices connect. Option 2 is best if you can control what devices connect.

Andrew Sledge
I use a router with DD-WRT. I would just scarp the page that lists the connected devices rather than mess with writing modules.
Greg
That's certainly a workable approach if it can be relied upon.
Andrew Sledge
A: 

In theory, yes - if your wireless router exposes an API that you can hook into to get the list of currently connected clients, then it's likely that you can write something in C# that will poll the API for changes.

Practically speaking, I'm not aware of any wireless router that actually does what I proposed above. Then again, I've never really looked into it so who knows!

Brian Driscoll
All of the ones I've used have a client list, complete with MAC addresses.
Paul Ruane
Yes, but how many of them make that list available in an API? Screen scraping is an option, I suppose, but not a very robust one.
Brian Driscoll