URL validation in a textbox

  • Thread starter Thread starter ALI-R
  • Start date Start date
A

ALI-R

I have a text box where user is supposed to enter a URL , How can I
programmatically figure out the a URL that user has been entered is valid or
not ,I mean wethere it exist or not????

thanks
 
Use the HttpWebResponse class to try to connect to the resource. If you get
back a 404, then it does not exist.

On a side note, it might not be worth the effort to validate that the
resource actually exists. There is a lot of overhead with web connections.
This is my opinion and obviously depends on your application's needs.
 
It is acutally in our interanet not Internet and I have to do that .the
reasion is below:

I have several Sql servers on the network ,some of them has reporting
services installed on it and some dosn't have.Unfortunately there is no way
of lisitng existing Reporting servers,so what I have to do is to list sql
seevrs and when user clicks on it ,kind of message that say,"there is no
reporting service insatlled on this server choose another one"

Thanks for your help,anyways
ALI
 
Back
Top