By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,616 Members | 2,026 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,616 IT Pros & Developers. It's quick & easy.

check if link is active?

P: n/a
Is there a way to be able to check a url link to see if it is active or not?
Example. I put urls to images in an Iframe on my site. If they change the
url, It gives me an image not found error. I want to make a service that
runs every 3 days to check theses links for validity?

--

dave
Nov 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
You could write a service or scheduled task that will go out and ping the
site.

Basically you could do something like (this may not work as-is, but it give
you an idea):

try{
HttpWebRequest req =
(HttpWebRequest)WebRequest.Create(http://mysite.com/mypage.aspx);
HttpWebResponse resp = req.GetResponse();
} catch(WebException e) {
// Status code in "e" will tell you why it failed.
}

(http://mysite.com/mypage.aspx);
"DaveF" <df*****@geodecisions.com> wrote in message
news:ei**************@tk2msftngp13.phx.gbl...
Is there a way to be able to check a url link to see if it is active or not? Example. I put urls to images in an Iframe on my site. If they change the
url, It gives me an image not found error. I want to make a service that
runs every 3 days to check theses links for validity?

--

dave

Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.