none
http status code in web browser control RRS feed

  • Question

  • hello friends,
    i need help in finding how to get http status code like 200, 401 etc from webbrowser control in c#.
    i mean if an element on webpage like an image is downloaded successfully it should display 200 fails 401 or other code for other reasons.
    i dont want to use httpwebresponse.statusCode
    can any one help me pls...
    Friday, December 4, 2009 10:38 AM

Answers

  • It does not return "ok", it returns an enumeration containing the value. For you as developer, this is very useful because you can check for HttpStatusCode.Ok instead of 200.

    Just cast the StatusCode to an integer and you will have the right value.
    Geert van Horrik - CatenaLogic
    Visit my blog: http://blog.catenalogic.com

    Looking for a way to deploy your updates to all your clients? Try Updater!
    • Marked as answer by Imran_ims Friday, December 11, 2009 4:59 AM
    Thursday, December 10, 2009 2:06 PM

All replies

  • "i dont want to use httpwebresponse.statusCode "

    And why is that? And do you host the web control yourself, or must it be the browser of the user (thus Internet Explorer or something like that)?
    Geert van Horrik - CatenaLogic
    Visit my blog: http://blog.catenalogic.com

    Looking for a way to deploy your updates to all your clients? Try Updater!
    Monday, December 7, 2009 4:12 PM
  • thanks for the reply dude !!!

    i dont want to use httpwebresponse.statuscode  because it doesn't return me all the status codes like 304,302,200,204,401 etc. it just returns "ok".

    and i have hosted a webbrowser control in my application..

    please help me dude!!!
    Tuesday, December 8, 2009 4:46 AM
  • can any1 help me plz
    Wednesday, December 9, 2009 7:00 AM
  • It does not return "ok", it returns an enumeration containing the value. For you as developer, this is very useful because you can check for HttpStatusCode.Ok instead of 200.

    Just cast the StatusCode to an integer and you will have the right value.
    Geert van Horrik - CatenaLogic
    Visit my blog: http://blog.catenalogic.com

    Looking for a way to deploy your updates to all your clients? Try Updater!
    • Marked as answer by Imran_ims Friday, December 11, 2009 4:59 AM
    Thursday, December 10, 2009 2:06 PM