How to capture HTTP server return codes using the webbrowser control with Visual Basic
Posted on 2004-03-25
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?