Click here to Skip to main content
15,895,011 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to get the name of the router device which is connected to my computer.
I will explain this situation with an example. This example will be hypothetical;
I am working in the building which contain a lot of router device. every room has a router device. and i want to learn about which router connected with which computer. I know router names by looking on the router device. so when I type command line "ping 'the router device name'". then I am learning router device ip. There is a few employees in each room and every employees have a portable computer which is belong to company. My boss said to me can you learn which computer is which room in real time. I can deal with this problem. if i could learn router device name -which is connected my computer- with c#. I will make an application which is writing name/ip of router device in database on network. all portable computers will have this app. so i will be able to learn which computer is which room in real time. my problem is not to know how to get router device name/ip. Is it clear?

By The way I know all portable computer's name which are belong to company. So I can match rooms and computer's names.
Posted

1 solution

Your machine is not connected to a router. It's connected to a network. The router, or some other device, is a gateway to other networks.

The gateway address your machine has is the near-side of the gateway of the local network used to route traffic to other networks. It's possible for the gateway to be some other device other than a router.

What you're talking about is not trivial. You're not going to get a full description of how to do this in a few forum posts.

You're going to need a SNMP library to handle discovering devices on the network for you. There is an open source library called SnmpSharpNet[^] that can do that.
 
Share this answer
 
Comments
Emin ATEŞ 26-May-15 15:41pm    
thanks for your answer. I will try the library. If I will be succsess to get router device name/ip. I share the project. And accept your solution :)
Emin ATEŞ 27-May-15 9:31am    
Again me . I apologise but can you write me a document/website to learn the snmp#net library? I found #snmp library, when i was searching for snmp#net. Is #snmp library used for the same subject with the snmp#net library?
Dave Kreskowiak 27-May-15 11:27am    
No, I can not write you documentation on how to use the library and how to do what you want. I simply don't have the time.

This is where YOU do the research on the library and what you need to do to discover devices on the network.
Emin ATEŞ 27-May-15 15:54pm    
No I do not want the document which written by you. Surely I do the search on the research. But I couldn't find. I don't want fish. I want to learn fishing. But I have not book which name is "Fishing". :) So I mean If you know, can you write website name, article , etc. about this subject on this website. Thanks for your help
Dave Kreskowiak 27-May-15 19:08pm    
Really? Finding the documentation on the library is not hard at all. Google "snmpsharpnet documentation[^]

It even comes up with examples!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900