0

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

user70192
  • 13,786
  • 51
  • 160
  • 240

2 Answers2

2

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

spender
  • 117,338
  • 33
  • 229
  • 351
1

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.

Brian Agnew
  • 268,207
  • 37
  • 334
  • 440