Solved

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

Posted on 2004-03-25
1
448 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
hosting images 4 35
Select only the top record in a left join 13 45
tutorial for ebay api 3 55
website rewamp 5 42
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
An enjoyable and seamless user experience can go a long way on an eCommerce site. While a cohesive layout and engaging copy play roles in creating a positive user experience, some sites neglect aspects that seem marginal but in actuality prove very …
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

828 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