如何获取路由器设备名称/ IP [英] how to get router device name/ip

查看:403
本文介绍了如何获取路由器设备名称/ IP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何获取连接到我的电脑的路由器设备的名称。

我将用一个例子解释这种情况。这个例子将是假设的;

我在建筑物中工作,其中包含许多路由器设备。每个房间都有一个路由器设备。我想了解哪台路由器与哪台计算机连接。我通过查看路由器设备了解路由器名称。所以当我输入命令行ping路由器设备名称'时。然后我正在学习路由器设备ip。每个房间都有一些员工,每个员工都有一台属于公司的便携式计算机。我的老板对我说,你可以实时了解哪台电脑是哪个房间。我可以处理这个问题。如果我能学习路由器设备名称 - 它与我的计算机连接 - 用c#。我将创建一个应用程序,它在网络上的数据库中写入路由器设备的名称/ IP。所有便携式电脑都有这个应用程序。所以我将能够实时了解哪台计算机是哪个房间。我的问题是不知道如何获得路由器设备名称/ IP。是否清楚?



顺便说一下,我知道属于公司的所有便携式计算机的名称。所以我可以匹配房间和计算机的名称。

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.

推荐答案

您的机器未连接到路由器。它连接到网络。路由器或其他设备是通往其他网络的网关。



您的机器所具有的网关地址是所使用的本地网络的网关的近端将流量路由到其他网络。网关可能是除了路由器之外的其他设备。



你所谈论的并不是微不足道的。你不会在一些论坛帖子中得到如何做到这一点的完整描述。



你将需要一个SNMP库来处理发现设备在网络上为你服务。有一个名为 SnmpSharpNet 的开源库[ ^ ]可以做到这一点。
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.


这篇关于如何获取路由器设备名称/ IP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆