anon271334
anon271334

Reputation:

Checking Response Code C#

I was wondering if there's a way to detect the response codes on a website using C#? Since C# .NET has HTTP-based methods, I'm assuming that it can be done?

Thank you

Upvotes: 0

Views: 345

Answers (2)

Aryabhatta
Aryabhatta

Reputation:

The first link on google search reveals:

HttpWebResponse rep = req.GetResponse();
HttpStatusCode c = rep.StatusCode;

The link: http://bytes.com/topic/c-sharp/answers/267762-retrieving-http-response-code

Upvotes: 3

AdamW
AdamW

Reputation: 1061

Yes, the HTTPWebResponse class contains a statusCode property.

Upvotes: 0

Related Questions