|
-
May 17th, 2006, 03:23 PM
#1
Thread Starter
Frenzied Member
[2.0] Checking if a website / web page exists?
Hi all!
Does anyone have a way to check if a web page / website exists? Right now I'm simply catching the error that results when it does not but I'm wondering if there is a way to simply check that the page exists before trying to access it at all.
Cheers,
Ryan Jones
-
May 17th, 2006, 04:22 PM
#2
Re: [2.0] Checking if a website / web page exists?
You could send a "HEAD" request to the server. Google should have loads of info about how to do this.
You could do it with an HTTPWebRequest object.
Then you check the stream that the server sends back if the first line contains "200" then you are in business, if you get a "404" instead you know what that means
I don't live here any more.
-
May 17th, 2006, 05:13 PM
#3
Thread Starter
Frenzied Member
Re: [2.0] Checking if a website / web page exists?
 Originally Posted by wossname
You could send a "HEAD" request to the server. Google should have loads of info about how to do this.
You could do it with an HTTPWebRequest object.
Then you check the stream that the server sends back if the first line contains "200" then you are in business, if you get a "404" instead you know what that means 
Hmm, I will try the second one first and if that fails then I'll try the first - thanks 
Cheers,
Ryan Jones
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|