By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,465 Members | 1,511 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,465 IT Pros & Developers. It's quick & easy.

Router state

P: n/a
Hi,
I have a home network with a DSL router. I want to check the router state
(connected, disconnected...) from an XP computer on the network by showing an
icon (green / red) in the system tray.
I am new in C# and I am checking for some hints on how to do it. Thanks!
VMAM
Jan 31 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Detecting the state depends on many things.
If you are lucky, the NetworkChange class could work for you.

"VMAM" <VM**@discussions.microsoft.comha scritto nel messaggio
news:D7**********************************@microsof t.com...
Hi,
I have a home network with a DSL router. I want to check the router state
(connected, disconnected...) from an XP computer on the network by showing
an
icon (green / red) in the system tray.
I am new in C# and I am checking for some hints on how to do it. Thanks!
VMAM

Jan 31 '07 #2

P: n/a
Laura T. <LT@NOWHERE.COMwrote in message
<e$**************@TK2MSFTNGP06.phx.gbl>:
>Detecting the state depends on many things.
If you are lucky, the NetworkChange class could work for you.

"VMAM" <VM**@discussions.microsoft.comha scritto nel messaggio
news:D7**********************************@microso ft.com...
>>Hi,
I have a home network with a DSL router. I want to check the router
state (connected, disconnected...) from an XP computer on the
network by showing an icon (green / red) in the system tray.
I am new in C# and I am checking for some hints on how to do it.
Thanks! VMAM
some also may be accessible via SNMP

--
Brad Prendergast
"Wars have never hurt anybody except the people who die." -- Salvador
Dali (1904 - 1989)
Jan 31 '07 #3

P: n/a
Vmam,

In depends on the router you have and what you mean by connected. If you
just want to know if your router is connected to your isp, and you have
a router that has a web interface for administration, here one thing you
can do:

1.) Use the WebClient class to connect to your router's status page and
pull the html.

2.) Parse the html for some information that will tell you weather the
router is connected or disconnected. (You could look to see if your
router has a wan ip address from your isp or not...)

You may need to use regular expressions for this. (take a look at Regex
class)

3.) Based on what you find in the html, you can then place an icon in
the systray.

The Software Jedi at http://www.thesoftwarejedi.com/ has several apps
that might help you. Take a look at Google Wallpaper. You might want to
download my version from here http://deciacco.com/blog/archives/45 as I
updated it to work with some recent changes on google's site. I also
make use of regular expressions, which the original does not. This app
has code examples in it for everything you need to do, from putting an
icon in the systray to using the webclient, to regular expressions.

Post a comment on my site to let me know how it goes...would be
interested in seeing your app when you are finished.

Hope this helps...good luck!!

-----Original Message-----
From: VMAM [mailto:VM**@discussions.microsoft.com]
Posted At: Wednesday, January 31, 2007 9:39 AM
Posted To: microsoft.public.dotnet.languages.csharp
Conversation: Router state
Subject: Router state

Hi,
I have a home network with a DSL router. I want to check the router
state
(connected, disconnected...) from an XP computer on the network by
showing an
icon (green / red) in the system tray.
I am new in C# and I am checking for some hints on how to do it. Thanks!
VMAM

Jan 31 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.