Url testing

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi
In order to test that if a web server is alive, I use webrequest.create(url)/weresponse.getresponse. This is a bit slow and i didn't find how to avoid webrequest going directly to catch (try/catch) when the url isn't correct.
So, is there another tool to test if an url is ok and alive
Thanks.
 
Hi, Oivier/noetika

You might want to use Uri.CheckHostName and other related methods of Uri
class before doing actual connection. It will help you to avoid some of
exceptions, but not all of them.
I don't see how else you can test if provided url is valid if not by trying
to connect to it. However this is also only partial solution, which is not
good when you are disconnected from network

HTH
Alex

Oivier/noetika said:
Hi,
In order to test that if a web server is alive, I use
webrequest.create(url)/weresponse.getresponse. This is a bit slow and i
didn't find how to avoid webrequest going directly to catch (try/catch) when
the url isn't correct.
 
Hello,

You could always Ping the web server.

Checkout (watch out for URL wrapping):
http://groups.google.com/[email protected]&rnum=4

-- Alex Papadimoulis

Oivier/noetika said:
Hi,
In order to test that if a web server is alive, I use
webrequest.create(url)/weresponse.getresponse. This is a bit slow and i
didn't find how to avoid webrequest going directly to catch (try/catch) when
the url isn't correct.
 
* "=?Utf-8?B?T2l2aWVyL25vZXRpa2E=?= said:
In order to test that if a web server is alive, I use webrequest.create(url)/weresponse.getresponse. This is a bit slow and i didn't find how to avoid webrequest going directly to catch (try/catch) when the url isn't correct.
So, is there another tool to test if an url is ok and alive ?

That's the way I would choose.
 
Back
Top