|
-
Sep 22nd, 2000, 08:27 PM
#1
Thread Starter
New Member
Hello, I was wondering if it is at all possible to get the headers from a loaded url using the WebBrowser control? I am writing a program in vb6 and basically, although the control lets you know that the document is complete etc... I want to know if the page existed, whether it was an internal server error and so on.
At the moment if the file I am attempting to load doesn't exist, the rest of the program becomes useless because I can't check the header, or check whatever it is I need to check to see if it was a 404, 200 etc... It would be nice to say send a message box and handle the error accordingly.
I am really struggling here, read tons of stuff but can't seem to put my finger on how to get the headers from a loaded document. Any help would be really appreciated!
-Paul
---------------------------> I know nothing 
-
Sep 23rd, 2000, 12:48 AM
#2
Take a look at this thread.
To get headers, use the Inet Control:
Code:
Private Sub Inet1_StateChanged(ByVal State As Integer)
On Error Resume Next
Select Case State
Case 3
Timer1.Enabled = True
End Select
End Sub
Private Sub Timer1_Timer()
Dim h
If Inet1.StillExecuting = False Then
h = Inet1.GetHeader
If Not h = "" Then
Text1.Text = Text1.Text & h
Timer1.Enabled = False
Inet1.Cancel
End If
End If
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|