user70192
user70192

Reputation: 14204

How to check to see if a web site is up

I am playing around with Silverlight. Currently, as a test to see if I like the technology, I'm building a utility. This utility simply checks to see if my web sites are up and running.

With Silverlight, C#, how do I ping a website (like www.google.com) to see if it is available?

Thank you

Upvotes: 0

Views: 217

Answers (2)

spender
spender

Reputation: 120420

You also have to fix up some sort of cross-domain permissions with strategically placed clientaccesspolicy.xml files to allow a Silverlight app running in one domain access to the other domains.

http://msdn.microsoft.com/en-us/library/cc645032%28VS.95%29.aspx

http://timheuer.com/blog/archive/2008/04/06/silverlight-cross-domain-policy-file-snippet-intellisense.aspx

Upvotes: 2

Brian Agnew
Brian Agnew

Reputation: 272247

In the simplest case, can you make a TCP connection on port 80 (the default HTTP port) and issue a GET or HEAD request ?

Note that determining if a site is up is a very subjective question. e.g.

  1. does it listen on port 80 ?
  2. does it respond to a HEAD/GET request ?
  3. is its underlying database available (or do you get an error page saying that underlying services are down) ?
  4. does it respond in a timely fashion ?

etc.

Upvotes: 1

Related Questions