Considering VB.NET 2.0 Network Ping

I have a web service that I wrote for one of my smart client apps to check for one of three states of connectivity: no network, local network connection to web server, web connection to the web server.

So I ping the web service at the local i.p. The operation returns a mystical “hello world”. If that times out, then I ping the service at the i.p. of the web server as it is exposed to the web via ISA Server. If that times out as well, then they are told (politely of course) that they are S.O.L. and need some type of network access to run these particular functions.

I have a client side assembly dedicated to this as well as the web service.

Now Visual Basic .NET 2.0 has My.Computer.Network.Ping to which you pass a URI and a timeout period. There is one small code benefit to me as I have to dynamically construct the web service URL and using the new method, I can just ping the i.p. and not care about a complete path to the web service. However, the Network.Ping method requires a bunch of permission that I don’t need in order to hit the web service. So I think that for now, I’ll leave it alone and wokr on other things for my migration.



Don’t Forget: www.acehaid.org

  Sign up for my newsletter so you don't miss my conference & Pluralsight course announcements!  

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.