473,385 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Is there any way to know the computer is connected to a router?

Is there any way to know the computer is connected to a router?

I know using WebRequest is one of the method,
but WebRequest need router's URL , username and password.
I don't know those information.

Is there any other way to know the existence of router?

Thanks.
Jun 27 '08 #1
5 1644
On Tue, 10 Jun 2008 00:28:12 -0700, garks <ze*********@gmail.comwrote:
Is there any way to know the computer is connected to a router?

I know using WebRequest is one of the method,
but WebRequest need router's URL , username and password.
I don't know those information.
That's not really a way to know if you're connected to a router anyway.
Is there any other way to know the existence of router?
If the router supports UPnP, that is the most reliable way. I don't
recall if that's directly supported in .NET or not.

If there is no UPnP support, then there are other less reliable ways based
on heuristics dependent on network behavior. I would not pursue those
kinds of methods though, especially if you're at a point in your network
experience where you have to ask the question in the first place. :)

The piece of information most likely applicable to whatever you're doing
is that you probably don't need to know whether you're connected to a
router, especially if it doesn't support UPnP.

Pete
Jun 27 '08 #2
Thank you for your reply.

I am a newbie to networking.
I search it over the internet very long time, but cannot find the clue
to solve the problem.
Could you explain more?

I am doing a project which writing a small window app.
It determines the computer that runs this app have a router connected
or not.
If yes, it will invoke event A. Otherwise invoke event B.

Thanks in advanced
Jun 27 '08 #3
On Jun 10, 10:50 am, garks <zenkiche...@gmail.comwrote:
Thank you for your reply.

I am a newbie to networking.
I search it over the internet very long time, but cannot find the clue
to solve the problem.
Could you explain more?

I am doing a project which writing a small window app.
It determines the computer that runs this app have a router connected
or not.
If yes, it will invoke event A. Otherwise invoke event B.

Thanks in advanced
Perhaps, if you traceroute an IP and if the path is greater than 2
hops, then the traffic is being routed. I am not sure if you determine
if the device routing your traffic is a router though. ??
Jun 27 '08 #4
"cs****@elfware.za.net" <el*****@gmail.comwrote in news:653b4e2e-ca41-
45********************@8g2000hse.googlegroups.com:
Perhaps, if you traceroute an IP and if the path is greater than 2
hops, then the traffic is being routed. I am not sure if you determine
if the device routing your traffic is a router though. ??
Only a router would decrement the TTL, which is what traceroute uses.

I'm still interested in knowing why the OP wants to know if the router is
present.

Another approach is to just ping the default gateway. If ping isn't
firewalled by the router, one should get a response. One could also port-
scan the firewall, in hopes that one of the ports is an administrative
interface and will respond to a connection request. Only a high-end router
with a very sophisticated firewall would totally obscure such an interface.
(For example, a very paranoid router might use port knocking to hide its
administrative interface, or it might not be available via the subnet that
the querying host is attached to.)

This isn't really a C# question, though. The best expertise would be found
at comp.protocols.tcp-ip. But frame the question in generic programming
terms, not as a C# question.
Jun 27 '08 #5
On Jun 10, 4:50*am, garks <zenkiche...@gmail.comwrote:
Thank you for your reply.

I am a newbie to networking.
We can see that
I search it over the internet very long time, but cannot find the clue
to solve the problem.
What is your problem to start with? You just asked a question but you
did not described your problem

>
I am doing a project which writing a small window app.
It determines the computer that runs this app have a router connected
or not.
You need to be more especific, start with explaning what you consider
a "router"
Jun 27 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Mickel Grönroos | last post by:
Hi all, I have a silly question. Is there are simple way to check if the computer is connected to the Internet? It seems this should be a pretty straight-forward thing to do, but as I am totally...
2
by: Frederik | last post by:
Hi all, Situation: - 2 computers behind router/switch - dhcp enabled on router - computer name 1 = cpuA (WinXP Pro) - computer name 2 = cpuB (WinXP Home) - cpuA and cpuB can access each...
19
by: Frederik | last post by:
Hi all, Situation: - 2 computers behind router/switch; - dhcp enabled on router; - computer name 1 = cpuA (WinXP Pro); - computer name 2 = cpuB (WinXP Home); - cpuA and cpuB can access each...
1
by: pavanG | last post by:
The following is the setup I have at home. The problem is I cannot ping Vista machine(192.168.2.5) from XP machine(192.168.2.2) So accessing it from Internet is Out of question My aim is to...
1
Mague
by: Mague | last post by:
hey, Im 13 and my family is run of a d-link router which i setup. This has been running alright now for over a year. Now my brothers computer doesnt connect. He is connected through an ethernet...
3
by: Joh | last post by:
I'd like to test a server application and a client application from the same computer. Currently if I let the client try to connect to my IPv4 adress provided by my router in this case 192.168.1.2...
1
by: vabh | last post by:
Hello, My computer is connected in LAN and so many other computers too. So, now i want to access any .exe file of any other computer. Before that i am accessing the Computer Name and IPAddress...
0
Elias Alhanatis
by: Elias Alhanatis | last post by:
Hello!! I have installed the latest Apache version on Windows Vista and it works fine as a service , and i also get the expected screen on 'localhost'. But when i try to access the web pages from...
18
by: AAaron123 | last post by:
I have a roadrunner personal page internet site. I just found out it does not support ASP.NET. I've developed an asp.net site that I would like to show someone. I can't image this is...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.