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.