The other day I was working on someone's computer whose internet would intermittently disappear. I had no way of tracking exactly when the internet would fail, however, so I created a piece of software that would do it for me. Behond, the BrandonSoft Network Status Checker. It also has a taskbar icon, so you don't have to have the annoying window open all of the time.
This is a nice small application. Sometimes it takes a billion years for a website to load, so I am not sure if my connection is down or not (sometimes it doesn't shows that internet is down). I find this helpful. However, I think it could be even better. Here is a challenge for you; try making it so it recognizes if you are connected to LAN. For example, if I set my IP to 192.168.0.<any number bigger than 0> it recognizes that I am connected to LAN. That would make this application even more helpful/nicer, in my opinion. <!-- s --><img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt="" title="Very Happy" /><!-- s -->
Also known as Rocketalypse. System.out.println("I prefer Java.");
I have updated the version to include the following
[code2=text]-The program now checks the internet connection against a custom website, making loading faster
-The program now doesn't store cache, fixing rare problems where network disconnects wouldn't show
-Timer interval adjuster added
-LAN Connectivity status added[/code2]
Download it at the top of this thread (Version .0.1.0.2)
You should add this to it so it will show the external IP this is something i cooked up a while back for a server app
Code
[code2=vbnet]Public ExternalIP As String
Private Sub GetIp()
Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create("http://www.pbaproductions.com/ip.php")
Dim response As System.Net.HttpWebResponse = request.GetResponse
Dim sr As System.IO.StreamReader = New System.IO.StreamReader(response.GetResponseStream())
Dim regsource As String = sr.ReadToEnd
ExternalIP = regsource
End Sub[/code2]
Website: <!-- m --><a class="postlink" href="http://www.PBAProductions.com">http://www.PBAProductions.com</a><!-- m -->
E-Mail: <!-- e --><a href="mailtoatrick@AriSystems.Org">Patrick@AriSystems.Org</a><!-- e -->
Skype: Qwaxer
Youtube: Qwaxer
When the softare is run, it will always focus on it so whenever I write Java in Eclipse (or anything else anywhere) the focus keeps on going off of the current window I opened.
Also known as Rocketalypse. System.out.println("I prefer Java.");
Even when it's opened and focused on BrandonSoft Network Status Checker, it unfocuses immediately. Basically, it happens all the time. You might've put some kind of code in the timer which sets focus on object that is not visible on the form.. or I don't know. It's weird.
Also known as Rocketalypse. System.out.println("I prefer Java.");
The main reason for this is because it actually uses a WebBrowser control to check the network. The program then becomes focused/unfocused when the webbrowser refreshes, I guess!
I'm sorry, but this is not an open source piece of software, bu is instead something that I plan on releasing to the public in the future. With that being said, I do not plan on releasing the source coe anytime soon.
Edit: However, it should be fairly easy to replicate. All the program does is check to see if it is capable of downloading a text file from the world wide web.
Private Sub GetIp()
Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create("http://www.brandonsoft.com/ip.php")
Dim response As System.Net.HttpWebResponse = request.GetResponse
Dim sr As System.IO.StreamReader = New System.IO.StreamReader(response.GetResponseStream())
Dim regsource As String = sr.ReadToEnd
Website: <!-- m --><a class="postlink" href="http://www.PBAProductions.com">http://www.PBAProductions.com</a><!-- m -->
E-Mail: <!-- e --><a href="mailtoatrick@AriSystems.Org">Patrick@AriSystems.Org</a><!-- e -->
Skype: Qwaxer
Youtube: Qwaxer
Thanks a lot, Xolara! I was actually messing around with this functionality previously, but for some reason I could not get the correct IP Address from the PHP file. Maybe I was simply getting the wrong one, I don't know. But I didn't know that getting the IP was that simple! Thanks for sharing! I have added it to the newest version.
I have updated the program to include the following.
[code2=text]-External IP Address is now displayed on the network status line
-IP Address information is now displayed in the tooltip button's text[/code2]
It's been a while, eh? Well.. I realized the old method of tracking internet connections was a little unstable. So I rewrote it. Version .0205 changes:
[code2=text]-Added an initialization period to get stats about the net
-Changed method of checking from browsing the web to downloading a webpage
-Timeout period increased from 2 seconds to 4 seconds, this triggers a "Disturbance"
-New timeout period added at 10 seconds, this triggers a "Disconnect"
-Interval now saves through program shutdown
-Network check now operates on separate thread, allows program to be more reliable.
-Packaged the program with NSIS instead of ClickOnce[/code2]
There are several other small changes to. Go ahead and download it on the first post in this thread! Enjoy!
Version .0.2.1.0:
[code2=text]-Changes the default way of checking the internet connection to reading the IP address from a .php file
>If the .php file cannot be found, there is no internet connection available
>This eliminates the need to read from the .php file later[/code2]