Solved

How to capture HTTP server return codes using the webbrowser control with Visual Basic

Posted on 2004-03-25
1
431 Views
Last Modified: 2008-02-01
I'm creating a program in Visual Basic that will launch a particular URL.  I need to be able to receive and act upon HTTP server messages.  For example I may want to capture and act upon HTTP error 500 - Bad script request or HTTP error 404.

The StatusTextChange event does fire with each status text change and I can see things like:

Start download from site: res://C:\WINDOWS\SYSTEM\SHDOCLC.DLL/http_500.htm
Downloading from site: res://C:\WINDOWS\SYSTEM\SHDOCLC.DLL/http_500.htm

I suppose I could parse these text messages looking for "http_500", "http_404", etc but I'm wondering if there's a more direct way?

0
Comment
Question by:mskvarenina
1 Comment
 
LVL 19

Accepted Solution

by:
Melih SARICA earned 125 total points
ID: 10704845

There must be a Property of the webbrowser which gives the server status code

 in webbrowser Control there is an event called NavigateError is triigered
   
  with this usage

   Private Sub object_NavigateError( _
      ByVal pDisp As Object, _
      ByVal URL As Variant, _
      ByVal TargetFrameName As Variant, _
      ByVal StatusCode As Variant, _
      ByRef Cancel As Boolean)

   In the status code parametre u ll get the Statsu codes that ll be listed at the fallowing Url

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/act/htm/actml_ref_hsco.asp

Hope it helpss
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Http hosting redirect issue 2 30
Using MS Code on my Mac 6 44
Error viewing ASP page 12 82
Editing login page in zencart. 2 14
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
This video teaches users how to migrate an existing Wordpress website to a new domain.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now