Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2004-03-25
1
Medium Priority
?
477 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 500 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

New Tabletop Appliances Blow Competitors Away!

WatchGuard’s new T15, T35 and T55 tabletop UTMs provide the highest-performing security inspection in their class, allowing users at small offices, home offices and distributed enterprises to experience blazing-fast Internet speeds without sacrificing enterprise-grade security.

Question has a verified solution.

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

Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
The Internet has made sending and receiving information online a breeze. But there is also the threat of unauthorized viewing, data tampering, and phoney messages. Surprisingly, a lot of business owners do not fully understand how to use security t…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

886 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